Skip to content

Implement Table per ACS Snapshot - #6515

Open
OriolMunoz-da wants to merge 15 commits into
mainfrom
oriol/e1.1-acs-snapshot-migration
Open

OriolMunoz-da wants to merge 15 commits into
mainfrom
oriol/e1.1-acs-snapshot-migration

Conversation

@OriolMunoz-da

@OriolMunoz-da OriolMunoz-da commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #6262
Fixes #6263
Fixes #6264

[ci]

Signed-off-by: Oriol Muñoz <oriol.munoz@digitalasset.com>
Comment on lines +4 to +8
-- these values won't be set anymore
drop constraint acs_snapshot_first_row_id_fkey,
drop constraint acs_snapshot_last_row_id_fkey,
alter column first_row_id drop not null,
alter column last_row_id drop not null,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't find mention of this in the design, but it's necessary

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

Comment on lines +2 to +3
-- the name 'table_name' is not reserved, but it is a PostgreSQL keyword, so we use a different name to avoid confusion
add column data_table_name text default null,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems like a sensible deviation from the design

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes that's fine

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Included the minimal changes to validate:

legacy snapshots remain readable.

@@ -0,0 +1,14 @@
alter table acs_snapshot

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

by the way: the table acs_incremental_snapshot probably needs the table name for the same reason this one does
OR
if it's derived from target_record_time, then so can acs_snapshot and therefore we don't need to add the column

wdyt?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and also: this makes me consider not merging this to main until the rest of E1 is done, because I expect other surprises to popup

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good to wait for merging

@OriolMunoz-da
OriolMunoz-da marked this pull request as ready for review July 22, 2026 13:24

@ray-roestenburg-da ray-roestenburg-da left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but as you say, maybe better to wait with merging

[ci]

Signed-off-by: Oriol Muñoz <oriol.munoz@digitalasset.com>
Signed-off-by: Oriol Muñoz <oriol.munoz@digitalasset.com>
* tentative SQL

Signed-off-by: Oriol Muñoz <oriol.munoz@digitalasset.com>

* support ACS snapshots per table

Signed-off-by: Oriol Muñoz <oriol.munoz@digitalasset.com>

* fixes

Signed-off-by: Oriol Muñoz <oriol.munoz@digitalasset.com>

* add v2 tests and get it to work [ci]

Signed-off-by: Oriol Muñoz <oriol.munoz@digitalasset.com>

* [ci] refactor and remove TODOs

Signed-off-by: Oriol Muñoz <oriol.munoz@digitalasset.com>

* fix/add todos [ci]

Signed-off-by: Oriol Muñoz <oriol.munoz@digitalasset.com>

* [ci] scalafmt

Signed-off-by: Oriol Muñoz <oriol.munoz@digitalasset.com>

* [ci] prevent tablename collisions

Signed-off-by: Oriol Muñoz <oriol.munoz@digitalasset.com>

* fix imports

Signed-off-by: Oriol Muñoz <oriol.munoz@digitalasset.com>

* ddl lock on drop

Signed-off-by: Oriol Muñoz <oriol.munoz@digitalasset.com>

* distinct on

Signed-off-by: Oriol Muñoz <oriol.munoz@digitalasset.com>

* Move migration

Signed-off-by: Oriol Muñoz <oriol.munoz@digitalasset.com>

* fixes

Signed-off-by: Oriol Muñoz <oriol.munoz@digitalasset.com>

* properly fix the query which probably breaks indexes

Signed-off-by: Oriol Muñoz <oriol.munoz@digitalasset.com>

* whatever

Signed-off-by: Oriol Muñoz <oriol.munoz@digitalasset.com>

* [ci] make it compile

Signed-off-by: Oriol Muñoz <oriol.munoz@digitalasset.com>

* [ci] fixes

Signed-off-by: Oriol Muñoz <oriol.munoz@digitalasset.com>

* [ci] new table definition

Signed-off-by: Oriol Muñoz <oriol.munoz@digitalasset.com>

* update query

Signed-off-by: Oriol Muñoz <oriol.munoz@digitalasset.com>

* review comment: use table names

Signed-off-by: Oriol Muñoz <oriol.munoz@digitalasset.com>

* update metric tracking

Signed-off-by: Oriol Muñoz <oriol.munoz@digitalasset.com>

* versioning

Signed-off-by: Oriol Muñoz <oriol.munoz@digitalasset.com>

* use ddl lock

Signed-off-by: Oriol Muñoz <oriol.munoz@digitalasset.com>

* [ci] run

Signed-off-by: Oriol Muñoz <oriol.munoz@digitalasset.com>

* [ci] add test for QueryAcsSnapshotPaginationTokenTest serde

Signed-off-by: Oriol Muñoz <oriol.munoz@digitalasset.com>

* add todo #7438

Signed-off-by: Oriol Muñoz <oriol.munoz@digitalasset.com>

---------

Signed-off-by: Oriol Muñoz <oriol.munoz@digitalasset.com>
* make tests pass

Signed-off-by: Oriol Muñoz <oriol.munoz@digitalasset.com>

* [ci] cleanup

Signed-off-by: Oriol Muñoz <oriol.munoz@digitalasset.com>

* [ci] scalafmt

Signed-off-by: Oriol Muñoz <oriol.munoz@digitalasset.com>

* enable in all tests

Signed-off-by: Oriol Muñoz <oriol.munoz@digitalasset.com>

* [ci] fix concurrent runs

Signed-off-by: Oriol Muñoz <oriol.munoz@digitalasset.com>

* [ci] scalafmt

Signed-off-by: Oriol Muñoz <oriol.munoz@digitalasset.com>

* [ci] stupid imports

Signed-off-by: Oriol Muñoz <oriol.munoz@digitalasset.com>

* [ci] fix config

Signed-off-by: Oriol Muñoz <oriol.munoz@digitalasset.com>

* [ci] fix sanity check forcing resume ACS snapshot trigger

Signed-off-by: Oriol Muñoz <oriol.munoz@digitalasset.com>

* [ci] no need to drop tables

what was i even thinking

Signed-off-by: Oriol Muñoz <oriol.munoz@digitalasset.com>

* Add ACS snapshot table indexes (#6834)



---------

Signed-off-by: Oriol Muñoz <oriol.munoz@digitalasset.com>

---------

Signed-off-by: Oriol Muñoz <oriol.munoz@digitalasset.com>
Signed-off-by: Oriol Muñoz <oriol.munoz@digitalasset.com>
Signed-off-by: Oriol Muñoz <oriol.munoz@digitalasset.com>
@OriolMunoz-da OriolMunoz-da changed the title Add data_table_name to ACS snapshots Implement Table per ACS Snapshot Sep 28, 2026
Signed-off-by: Oriol Muñoz <oriol.munoz@digitalasset.com>
@OriolMunoz-da
OriolMunoz-da enabled auto-merge (squash) September 28, 2026 13:33
Signed-off-by: Oriol Muñoz <oriol.munoz@digitalasset.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

E1.3 Dual-read query path E1.2 Forward writes to per-snapshot tables E1.1 Schema prep (flyway)

2 participants