fix: initialize shadow snapshot state

This commit is contained in:
zgw
2026-09-03 13:52:52 +08:00
parent 3e9f61487c
commit 749bd49c50
2 changed files with 16 additions and 2 deletions

View File

@@ -234,6 +234,16 @@ class ShadowSqlServerMigrationScriptTest {
"truncate table alg.decision_log");
}
@Test
void cleanInstallSeedsAuthoritativeWarehouseAsInitializing() throws IOException {
String install = normalize(resource("db/sqlserver/install-shadow.sql"));
assertThat(install).contains(
"insert into alg.shadow_snapshot_state "
+ "(warehouse_id, snapshot_generation, snapshot_status) "
+ "values ('01', 0, 'initializing')");
}
@Test
void claimUsesOnlyPackageHeartbeatAndA120SecondStaleThreshold() throws IOException {
String install = normalize(resource("db/sqlserver/install-shadow.sql"));