fix(jobs): 留痕清理独立接通历史存储开关;精简死逻辑并对齐陈旧注释

This commit is contained in:
windyboy
2026-09-11 14:26:44 +08:00
parent d909a88167
commit a84751bf03
14 changed files with 75 additions and 72 deletions
@@ -219,7 +219,7 @@ class PipelineSmokeTest {
}
/**
* FIFO 修复(G2端到端验收:兼容入口写入的高 ID **不会被提前领取**,
* FIFO 不变量"只领取已发现的行"端到端验收:兼容入口写入的高 ID **不会被提前领取**,
* 必须等水位追平(较小 ID 补齐并入队)之后才按顺序处理。
*/
@Test
@@ -101,4 +101,21 @@ class HistorySweepJobTest {
assertTrue(tombstone.payloadJson.contains("\"deleted\":true"))
assertEquals(null, f.findMainRow("F3"))
}
@Test
fun `snap log purge runs independently of the history store switch`() {
val f = seededFlight("F1", deleted = true, idleDays = 30)
var cutoff: Instant? = null
val purge = com.gzzn.omms.msgexchange.infra.persistence.SnapshotLogPurge { instant -> cutoff = instant; 7 }
val job = HistorySweepJob(
f, StubMsgEvents(), HistoryProps().apply { historyStoreEnabled = false }, snapLogPurge = purge,
)
val outcome = job.run(now)
assertEquals(7, outcome.snapLogPurged) // 留痕清理不依赖历史存储开关
assertEquals(0, outcome.purged) // 航班当前态仍一条不许删
assertTrue(f.findMainRow("F1") != null)
assertTrue(cutoff != null)
}
}