Repository navigation
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
d6ca7b6 to
d5227d3
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d5227d37ee
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| let split = split_builder.finalize()?; | ||
| packaged_splits.push(package_split(split, &self.tag_fields, ctx)?); |
There was a problem hiding this comment.
Finalize all writers before packaging splits
When a workbench contains many partition builders (especially with QW_ENABLE_IN_MEMORY_INDEXING), this packages each finalized split while the iterator still owns all remaining SingleSegmentIndexWriters, and every resulting hotcache_bytes allocation remains retained in packaged_splits. At a heap-limit flush this layers accumulating hotcaches over the still-live writer/RAM-directory buffers and can push indexing into an OOM; the removed serializer avoided this by finalizing every builder before the packager allocated any hotcaches. Preserve that two-pass ordering inside the Indexer.
Useful? React with 👍 / 👎.
d5227d3 to
61f28b4
Compare
61f28b4 to
964db09
Compare
964db09 to
88ef471
Compare
Why
The Indexer hands finished batches to a separate IndexSerializer actor and yields the CPU. The serializer may not be scheduled immediately, leaving a gap before serialization starts. Running serialization and packaging inside the Indexer removes those actor handoffs and their scheduling delays. We want to finish as fast a possible to release memory.
Changes
Mailboxes and backpressure
Capacities count messages, which can contain batches. Capacity
0is a rendezvous: sending waits until the receiver accepts the message.The serializer could process one batch while the Indexer built the next, despite its zero-capacity mailbox. Serialization and packaging now finish before the Indexer processes more documents. Removing the packager also removes its queued batch and separate in-progress work.
This trades pipeline overlap and buffering for fewer scheduling handoffs. Uploader backpressure reaches the Indexer or MergeExecutor directly. Upload concurrency remains semaphore-controlled, and handoff waits for acceptance rather than upload completion.
Operational changes
index_serializercomponent toindexer.delete_task_executor; the separatepackagerentry is removed.Verification