Skip to content

fix: revalidate vacuum links after row locking - #54

Merged
pathscale merged 1 commit into
masterfrom
fix/beta5-versioned-vacuum
Aug 5, 2026
Merged

fix: revalidate vacuum links after row locking#54
pathscale merged 1 commit into
masterfrom
fix/beta5-versioned-vacuum

Conversation

@pathscale

Copy link
Copy Markdown
Owner

Summary

Fixes the intermittent versioned-publication failure observed on master in the WTI vacuum/upsert test.

Failed run: https://github.com/pathscale/WorkTable/actions/runs/30966635834

Vacuum snapshots reverse-index candidates before waiting for each row lock. A concurrent reinsert can move the primary key and retire or recycle the captured physical link during that wait. The old path trusted the captured link after locking, so it could move a different row and publish that row under the stale primary key.

This change:

  • re-resolves the forward primary-index link after acquiring the row lock and mutation gate
  • skips the candidate unless the captured link is still current
  • uses LockGuard so lock and mutation-gate cleanup remains RAII-safe on errors
  • adds a deterministic regression that moves the target key, recycles the stale slot for a different row, and verifies vacuum refuses the stale move

Verification

  • Regression mutation check: disabling the new comparison makes the deterministic test fail
  • Deterministic stale-link regression: passed
  • Original red WTI vacuum/upsert test: passed 20 consecutive repetitions
  • cargo test --workspace --all-targets --features versioned-row-publication: 515 passed, 0 failed, 4 ignored
  • cargo clippy --all-targets --features versioned-row-publication -- -D warnings
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo fmt --all -- --check

The Beta 5 release run later passed, confirming the failure is intermittent; the prior red exposed a concrete stale-link correctness race.

@pathscale
pathscale merged commit 1f4a822 into master Aug 5, 2026
4 of 5 checks passed
@pathscale
pathscale deleted the fix/beta5-versioned-vacuum branch August 5, 2026 06:12
pathscale pushed a commit that referenced this pull request Aug 5, 2026
Vacuum stale-link revalidation (#54) + fixed-width in-place update fix (#55):
single-column updates on String-bearing tables now swap archived fields in
place instead of full-row reinsert (~8x faster), and the unused per-update
UUIDv7 is elided on non-persistent tables.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant