Skip to content

fix: preserve in-flight worker search indices - #843

Open
OskarEichler wants to merge 1 commit into
krisk:mainfrom
OskarEichler:codex/snapshot-worker-search-indices
Open

OskarEichler wants to merge 1 commit into
krisk:mainfrom
OskarEichler:codex/snapshot-worker-search-indices

Conversation

@OskarEichler

Copy link
Copy Markdown

Problem

FuseWorker.search() rewrites shard-local indices after awaiting worker responses, but it reads each shard’s live globalIndices at that later time. If setCollection() completes while a prior search response is in flight, the old result items are rewritten through the new collection’s mapping. Returned item and refIndex can therefore disagree or the index can become undefined.

Fix

  • Snapshot each shard’s index mapping when the search is dispatched.
  • Rewrite that search’s responses through its own snapshot.
  • Keep searches parallel; no operation-wide serialization is added.
  • Add a delayed-response regression that replaces the collection before the old search resolves and verifies every item/index pair.
  • Rebuild the committed worker proxy distributions.

Verification

  • Focused worker suite: 19 tests passed.
  • Full suite: 22 files and 450 tests passed.
  • ESLint and TypeScript checks passed.
  • Worker distributions rebuilt successfully.
  • Changed files pass Prettier and git diff --check.

This branch has not been deployed

No deployments
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