Reproduce and fix hnsw race #386#415
Conversation
…gnaling This commit enables coordinated retry mode for RocksDB transactions and updates the commit logic to handle retry signals from the database. Instead of catching ERR_BUSY errors, transactions now check for RETRY_NOW_VALUE in the commit result and retry accordingly. Also adds retryOnBusy option to structure save transactions.
| ], | ||
| }); | ||
| for (let w = 0; w < WORKER_COUNT; w++) { | ||
| workers.push(new Worker(__dirname + '/vectorIndex-thread.js')); |
There was a problem hiding this comment.
Missing worker file — test will always fail.
vectorIndex-thread.js is referenced here but does not exist in the PR (or anywhere in the repo). new Worker with a nonexistent path causes each worker to emit an error event; the test collects those via the worker.once('error', ...) handler and the final assert.deepEqual(errors, []) will always fail.
The existing analog for this pattern is unitTests/resources/create-thread.js. A vectorIndex-thread.js counterpart needs to be added — it should:
- Import
setupTestDBPath+setMainIsWorker, call both at startup - Set up the
HNSWConcurrentTesttable - Listen on
parentPortfor{ type: 'insert', start, count, dims }messages - Perform the PUTs and reply with
{ type: 'done' }(or{ type: 'error', ... }on failure)
Review: PR #415 — HNSW concurrent PUT / coordinated RocksDB retrySummaryThis PR has two independent parts:
1. Missing
|
|
The integration and unit tests seem proper miffed with the changes... |
Yeah, that's because this PR is dependent on changes in rocksdb-js that haven't been merged/published. |
|
The fix is much simpler than introducing this |
Reproduction and fix for #386
Depends on HarperFast/rocksdb-js#531
This is marked as ready for review, although it is not ready to merge.