fix: per-batch session.commit() for snapshot and commit writes in finalization
Phase 7 (snapshots) and phase 8 (commit rows) were INSERTing in STREAM_COMMIT_BATCH_SIZE chunks but never committing between batches, leaving a single open transaction across all rows. For a 992-commit push this means hundreds of rows held in-flight — the connection stays active but the transaction is unnecessarily large and any mid-write error loses all batches.
Fix: commit after each batch in both phases.
- Phase 7: await session.commit() after bulk_upsert_snapshot_entries per batch - Phase 8: await session.commit() after pg_insert(MusehubCommit) per batch
Phase 9 (branch pointer SELECT FOR UPDATE) and phase 10 (branch UPDATE + enqueue INSERT) remain in their own short final transaction — the branch pointer update is the last thing that makes commits reachable from the ref.
Restores P2-1 through P2-4 which verify per-batch durability and error recovery during large snapshot/commit pushes.
0 comments
muse hub commit comment sha256:c53805285a0da87271220163a24f965d1a728eb9e3afb9f09940f4a905398d65 --body "your comment"
No comments yet. Be the first to start the discussion.