Fix background job CommitGraph generation corruption and concurrent ObjectRef insert race
Three bugs caused the 'l pull' benchmark to time out waiting for 1001 commits:
1. Background job used _gen_map.get(parent, 0) as fallback when the parent commit was from a prior mpack (not in the current job's batch). This silently produced generation=1 for the delta commit whose parent had generation=1000, then session.merge() overwrote the correct value written by the inline path. Fix: DB lookup for parent generations not in _gen_map.
2. session.merge() on *Ref tables (ObjectRef, CommitRef, SnapshotRef) has a TOCTOU race when inline path and background job run concurrently: both SELECT find nothing, both try INSERT, one gets UniqueViolationError. Fix: reverted all *Ref table writes to _pg_insert().on_conflict_do_nothing(). CommitGraph keeps session.merge() since stale generation values must be overwritten.
3. _wait_indexed probe called muse log without -n, hitting the 1000-commit default page limit. With 1001 commits the probe always returned 1000 even after full indexing. Fix: pass -n str(n_commits + 10) to the log call.
0 comments
muse hub commit comment sha256:266ea404ff866b0f227c309d5dea843e291261c9c98f7f96d259e6918789daf4 --body "your comment"
No comments yet. Be the first to start the discussion.