Fix asyncpg 32767 bind-param overflow on MPackIndex inserts at xl scale
At xl (5000 commits, 25000 objects) the MPackIndex filter-then-add pattern produced a SELECT ... IN (...) with 35000 bind params (5k commits + 5k snapshots + 25k objects), exceeding asyncpg's 32767 limit. The job crashed with InterfaceError before writing any MPackIndex rows, making xl fetch hang indefinitely waiting for coverage that never arrived.
Fix: replace filter-then-add with chunked _pg_insert().on_conflict_do_nothing() in both the background job (mpack_index_rows) and mpack_gc (new_rows). Chunk size 5000 keeps each statement well under the param limit. on_conflict_do_nothing is correct here: the PK is (entity_id, mpack_id) and the model docstring already calls this out as the idiomatic pattern.
Also: _safe_delete_repo now warns instead of raises on cleanup failure — deletion can fail transiently while the background job is still writing to the repo; stale repos are purged at the next run's start. Added step-level timing and verbose _wait_indexed logging to bench_cli.py for xl-scale debugging.
0 comments
muse hub commit comment sha256:5aed54e2001fe3ba0230b494791d9b38b3ff4c9b3f60ef2a66e4adf51f7927e6 --body "your comment"
No comments yet. Be the first to start the discussion.