[BUG](fn-consumer): Replay from checkpoints - #7654
Conversation
Reviewer ChecklistPlease leverage this checklist to ensure your code review is thorough before approving Testing, Bugs, Errors, Logs, Documentation
System Compatibility
Quality
|
This comment has been minimized.
This comment has been minimized.
383b8b3 to
90b0f14
Compare
Reconstruct materialized state from the latest collection snapshot while hiding logs through the function checkpoint. Advance toward the queued work frontier in bounded chunks without requiring either endpoint to be a compaction boundary.
90b0f14 to
8a88306
Compare
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8a88306f33
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| record.final_operation = MaterializedLogOperation::Initial; | ||
| record.operation_log_index = None; |
There was a problem hiding this comment.
Exclude checkpointed metadata from later deltas
When the hidden replay prefix updates an existing record's metadata and a visible suffix operation later updates that record, resetting only final_operation leaves the prefix's metadata_to_be_merged/metadata_to_be_deleted entries in the record. The suffix is therefore materialized with both old and new changes, and compute_metadata_delta() compares all of them against the physical snapshot. StatisticsFunctionExecutor applies that delta to output state that already includes the checkpointed changes, so values changed before the completion offset are counted a second time. Preserve the checkpoint's metadata as a separate logical baseline and expose only suffix changes in the delta.
Useful? React with 👍 / 👎.

Description of changes
Test plan
cargo test -p chroma-segment materialization_cutoff --no-default-features -- --nocapturecargo test -p chroma-segment checkpoint_preserves_overwrite_as_log_backed_baseline --no-default-features -- --nocapturecargo test -p worker async_function_boundary -- --nocapturecargo test -p worker test_async_attached_function_boundaries -- --nocapturecargo fmt --all -- --checkcargo clippy -p worker -p chroma-segment --all-targets -- -D warningsMigration plan
No data migration or API change is required. Existing aligned checkpoints continue through the same path; unaligned checkpoints now replay from the preceding live snapshot and may finish at any queued log offset.
Observability plan
The existing async-function replay log includes the selected snapshot position, function completion offset, and target log offset so replay windows can be inspected in production.
Documentation Changes
None. This changes internal fn-consumer execution semantics and does not alter user-facing APIs.