haiku.rag/tests/cassettes/test_versioning
Yiorgis Gozadinos 2da294b850
Put multi-table writes behind one transaction boundary
Four call sites repeated lock, snapshot, try/except, restore. Each used
restore_table_versions, which restores in _tables() order — documents
first, contradicting RESTORE_TABLE_ORDER — and each caught Exception, so
a cancellation mid-write skipped rollback and left the earlier table
writes committed.

Store.write_transaction() holds the lock, snapshots under it, and rolls
back through _rollback_to_snapshot: RESTORE_TABLE_ORDER, shielded from
cancellation, absorbed cancellation re-delivered, rollback failure raised
with the original as cause. The two single-table update_meta sites keep
the bare lock.

The batch documents write moves inside the guarded body; it was outside
the try, so a failure there was never rolled back. Auto-vacuum is
scheduled after the transaction rather than inside it.

restore_table_versions is removed; those four sites were its only callers.
2026-08-19 14:05:40 +03:00
..
test_aexit_awaits_all_background_vacuums.yaml Track all in-flight background vacuum tasks, not just the last one 2026-04-24 14:42:53 +03:00
test_aexit_awaits_background_vacuum.yaml Add test for background vaccum being awaited 2026-04-24 14:42:52 +03:00
test_auto_vacuum_disabled_skips_vacuum.yaml Record cassettes for embedder, ignore huggingface while recording 2025-12-29 13:23:53 +02:00
test_auto_vacuum_enabled_triggers_vacuum.yaml Record cassettes for embedder, ignore huggingface while recording 2025-12-29 13:23:53 +02:00
test_cancellation_during_rollback_is_redelivered.yaml Put multi-table writes behind one transaction boundary 2026-08-19 14:05:40 +03:00
test_cancellation_mid_write_rolls_back.yaml Put multi-table writes behind one transaction boundary 2026-08-19 14:05:40 +03:00
test_rollback_failure_keeps_the_original_cause.yaml Put multi-table writes behind one transaction boundary 2026-08-19 14:05:40 +03:00
test_vacuum_completes_before_context_exit.yaml Record cassettes for embedder, ignore huggingface while recording 2025-12-29 13:23:53 +02:00
test_vacuum_with_retention_threshold.yaml Record cassettes for embedder, ignore huggingface while recording 2025-12-29 13:23:53 +02:00
test_version_rollback_on_create_failure.yaml Record cassettes for embedder, ignore huggingface while recording 2025-12-29 13:23:53 +02:00
test_version_rollback_on_update_failure.yaml Record cassettes for embedder, ignore huggingface while recording 2025-12-29 13:23:53 +02:00