Skip to content

Enforce the dropTable cross-worker-write reproducer; close #1381, #2496 - #2955

Merged
kriszyp merged 3 commits into
mainfrom
test/droptable-crossworker-enforce
Oct 9, 2026
Merged

kriszyp merged 3 commits into
mainfrom
test/droptable-crossworker-enforce

Conversation

@kriszyp

@kriszyp kriszyp commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Summary

Confirms the cross-worker write vs RocksDB table-drop race (#1381, #2496 — "Invalid column family specified in write batch" out of completeInterruptedDrops) is fixed on main, and turns its reproducer into an unconditional, enforced regression test.

unitTests/resources/dropTableCrossWorkerWrite.test.js's second test opened with an assert.ok tripwire on columnFamily.pendingReclaims, a stat that only exists in a @harperfast/rocksdb-js build that defers physical column-family drops behind admitted commits (rocksdb-js#850). It started as an unconditional it.skip, became a conditional this.skip(), then a hard assert so an older binding fails loud instead of skipping silently.

package.json now pins @harperfast/rocksdb-js@2.10.0 (ships #850), and harper's generation-distinct table stores (66c61089d, refs #1381) landed the other half of the fix. The stat always exists at this pin, so the assertion was a permanent no-op. This PR removes it so the reproducer runs unconditionally, and adds a one-line comment pointing at rocksdb-js#850 in its place — the deleted assertion was the file's only reference to that dependency.

Verification

Built dist/ and ran unitTests/resources/dropTableCrossWorkerWrite.test.js under node_modules/.bin/mocha 100 consecutive times on main (50 before this edit, 50 after): 0 failures, and the second test's raced > 0 assertion — confirming the race was actually exercised (a record lock held by the worker's in-flight commit at the moment dropTable() was called) — passed on every run.

Close recommendation

Both #1381 and #2496 can close:

For the human reviewer

  • Pre-push review (codex + gemini + cursor-composer + harper-domain, 3 rounds) landed on verdict: LGTM, no open in-scope findings.
  • One outside-this-diff finding was carried through adjudication and deliberately left unaddressed here (out of this task's scope): unitTests/resources/dropTableGeneration.test.js:247 has the same columnFamily.pendingReclaims precondition, now the only remaining deterministic guard on the binding capability now that this PR's reproducer checks it only behaviorally (raced > 0). The adjudicator's read: that's fine as-is — it's an assert.ok, not a skip, and production (resources/Table.ts:422, resources/Table.ts:446, resources/databases.ts:5375) reads the same stat name, so main would already be failing if the name drifted — but whether to reword its "bump the pin" message now that this file no longer carries a matching one is a judgment call left to the reviewer.

Framing-Verdict: chosen-approach-sound

🤖 Generated with Claude Code

https://claude.ai/code/session_01BqdNKW8ja6cPc238RVJJYZ

Review-Coverage: authored=claude; ran=gemini,cursor-composer,codex; adjudicated=domain; declined=cursor-grok,cursor-kimi,cursor-muse; rounds=3; full=1 @ f9268f7

Human-Review-Need: 3 (decisions: drop-binding-capability-precondition) @ f9268f7

kriszyp and others added 3 commits October 1, 2026 08:57
The reproducer's second test opened with an assert.ok tripwire on
columnFamily.pendingReclaims, a stat that only exists in a
@harperfast/rocksdb-js build that defers physical column-family drops
behind admitted commits (rocksdb-js#850). It started as an unconditional
it.skip, became a conditional this.skip(), then a hard assert so an
older binding fails loud instead of skipping silently.

package.json now pins rocksdb-js 2.10.0 (ships #850), and harper's
generation-distinct table stores (66c6108, refs #1381) landed the
other half of the fix. The stat always exists at this pin, so the
assertion is a permanent no-op; remove it and let the test run
unconditionally. Verified 100 consecutive runs (50 before this edit,
50 after) with 0 failures and the cross-worker race caught (raced > 0)
on every run.

Refs #1381
Refs #2496

Dispatch-Task: harper-enable-droptable-crossworker-reproducer
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BqdNKW8ja6cPc238RVJJYZ
The deleted assertion was this file's only reference to the binding
dependency; replace it with a comment so the link survives without
reintroducing a runtime gate (pre-push nit).

Dispatch-Task: harper-enable-droptable-crossworker-reproducer
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BqdNKW8ja6cPc238RVJJYZ
Per review: the longer wording over-narrated the existing assertions
and quoted the deleted guard's failure message.

Dispatch-Task: harper-enable-droptable-crossworker-reproducer
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BqdNKW8ja6cPc238RVJJYZ

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request simplifies the unit test in dropTableCrossWorkerWrite.test.js by removing the unused database import and removing an assertion that checked for columnFamily.pendingReclaims in the database stats. A comment has been added explaining that the test now relies on @harperfast/rocksdb-js to defer physical column-family drops behind admitted commits. There are no review comments, so I have no feedback to provide.

@kriszyp
kriszyp marked this pull request as ready for review October 9, 2026 23:56
@kriszyp
kriszyp merged commit f76b61b into main Oct 9, 2026
48 checks passed
@kriszyp
kriszyp deleted the test/droptable-crossworker-enforce branch October 9, 2026 23:56
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