-
Notifications
You must be signed in to change notification settings - Fork 61
Implement incremental acs snapshots #3733
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
5f293c9 to
cf930a7
Compare
[ci] Signed-off-by: Robert Autenrieth <robert.autenrieth@digitalasset.com>
[ci] Signed-off-by: Robert Autenrieth <robert.autenrieth@digitalasset.com>
Signed-off-by: Robert Autenrieth <robert.autenrieth@digitalasset.com>
[ci] Signed-off-by: Robert Autenrieth <robert.autenrieth@digitalasset.com>
[ci] Signed-off-by: Robert Autenrieth <robert.autenrieth@digitalasset.com>
[ci] Signed-off-by: Robert Autenrieth <robert.autenrieth@digitalasset.com>
[ci] Signed-off-by: Robert Autenrieth <robert.autenrieth@digitalasset.com>
cf930a7 to
97db5bc
Compare
OriolMunoz-da
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks! looking good, the only really blocking comment is the advisory lock one
Also, for testing, should we run https://github.com/DACH-NY/canton-network-node/issues/17033 on cilr after a while? (and ideally before this is merged, for a sanity check...)
...in/resources/db/migration/canton-network/postgres/stable/V054__incremental_acs_snapshots.sql
Show resolved
Hide resolved
apps/scan/src/main/scala/org/lfdecentralizedtrust/splice/scan/store/AcsSnapshotStore.scala
Show resolved
Hide resolved
apps/common/src/main/scala/org/lfdecentralizedtrust/splice/store/UpdateHistory.scala
Show resolved
Hide resolved
.../src/main/scala/org/lfdecentralizedtrust/splice/scan/automation/AcsSnapshotTriggerBase.scala
Show resolved
Hide resolved
.../src/main/scala/org/lfdecentralizedtrust/splice/scan/automation/AcsSnapshotTriggerBase.scala
Show resolved
Hide resolved
apps/scan/src/main/scala/org/lfdecentralizedtrust/splice/scan/store/AcsSnapshotStore.scala
Show resolved
Hide resolved
apps/scan/src/main/scala/org/lfdecentralizedtrust/splice/scan/store/AcsSnapshotStore.scala
Show resolved
Hide resolved
apps/scan/src/main/scala/org/lfdecentralizedtrust/splice/scan/store/AcsSnapshotStore.scala
Show resolved
Hide resolved
apps/scan/src/main/scala/org/lfdecentralizedtrust/splice/scan/store/AcsSnapshotStore.scala
Show resolved
Hide resolved
.../src/test/scala/org/lfdecentralizedtrust/splice/scan/automation/AcsSnapshotTriggerTest.scala
Show resolved
Hide resolved
...in/resources/db/migration/canton-network/postgres/stable/V054__incremental_acs_snapshots.sql
Show resolved
Hide resolved
...in/resources/db/migration/canton-network/postgres/stable/V054__incremental_acs_snapshots.sql
Show resolved
Hide resolved
...in/resources/db/migration/canton-network/postgres/stable/V054__incremental_acs_snapshots.sql
Show resolved
Hide resolved
apps/scan/src/main/scala/org/lfdecentralizedtrust/splice/scan/store/AcsSnapshotStore.scala
Show resolved
Hide resolved
| val now = context.clock.now | ||
|
|
||
| // Next, make sure we don't process too little. | ||
| if (now.isBefore(updateUntil)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice to have: a test checking this logic, or extract this in a separate method to easy unit test
| -- In production, we have a separate table for each scan instance so this | ||
| -- column will be the same for all rows. However, in tests we can have multiple | ||
| -- scan instances writing to the same table, so we need to include it. | ||
| history_id bigint not null references update_history_descriptors (id), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This table and the backfil one should have a foreign key to the acs_incremental_snapshot table, as discussed
| targetRecordTime = now.minusSeconds(1800L), | ||
| ) | ||
| previousIncrementalSnapshot(snapshot) | ||
| updatesBetween(currentMigrationId, now.minusSeconds(6000L), now.minusSeconds(1L)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe some more constants in these tests as we talked about, if that makes it easier to understand.
ray-roestenburg-da
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, in the right direction, main thing that you discovered during our chat, to handle the import updates
Fixes #2456