Skip to content

account for deferred points in proxies - #8477

Merged
generall merged 1 commit into
devfrom
deferred-in-proxy-fix
Mar 23, 2026
Merged

generall merged 1 commit into
devfrom
deferred-in-proxy-fix

Conversation

@generall

Copy link
Copy Markdown
Member

Previous PR incorrectly assumed that deferred points can only exist in appendable segment.
But ProxySegment is non-appendable and it can contain appendable segment with deferred points.

@generall
generall requested a review from JojiiOfficial March 22, 2026 19:03
Comment thread lib/shard/src/optimize.rs
Comment on lines +462 to +465
"proxied point deletes should have newer version than point in segment {} < {:?}, point id: {}",
versions.operation_version,
optimized_segment.point_version(point_id),
point_id,

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

this not stricitly related to this PR, but I found the original issue while debugging this assertion

@coderabbitai

coderabbitai Bot commented Mar 22, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

The pull request removes the appendable_only boolean parameter from LocalShard::do_with_segments, simplifying the method to always iterate over all segments rather than selectively. The implementation is refactored to unconditionally collect cloned segments, eliminating the conditional branch. Call sites have been updated: local_update_queue_info now computes deferred point counting over all segments instead of appendable-only segments, while local_shard_info maintains equivalent behavior through the unified collection path. Minor improvements include enhanced debug assertion messaging and formatting adjustments.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • timvisee
  • agourlay
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'account for deferred points in proxies' directly matches the PR's main objective of fixing deferred point handling in ProxySegments, clearly summarizing the primary change.
Description check ✅ Passed The description explains the bug fix: previous code incorrectly assumed deferred points only exist in appendable segments, but ProxySegment (non-appendable) can contain appendable segments with deferred points, which is directly related to the changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch deferred-in-proxy-fix

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

CodeRabbit can approve the review once all CodeRabbit's comments are resolved.

Enable the reviews.request_changes_workflow setting to automatically approve the review once all CodeRabbit's comments are resolved.

@coderabbitai coderabbitai 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.

🧹 Nitpick comments (1)
lib/collection/src/shards/local_shard/mod.rs (1)

982-987: Stale documentation references removed parameter.

The doc comment at lines 984-986 still describes the appendable_only parameter behavior, but this parameter was removed from the function signature. The documentation should be updated to reflect that the method now always iterates over all segments.

📝 Suggested doc comment update
     // Perform an operation using the shards segments.
     // This doesn't lock the SegmentHolder during the operation.
-    // The function also allows to specify which type of segments to iterate over.
-    // `appendable_only` iterates over both non-appendable and appendable segments if `false`
-    // and over appendable segments only if `true`.
+    // The function iterates over all segments (both appendable and non-appendable).
     fn do_with_segments<R, F>(&self, mut f: F) -> AbortOnDropHandle<R>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/collection/src/shards/local_shard/mod.rs` around lines 982 - 987, The doc
comment for the method do_with_segments still mentions the removed
appendable_only parameter; update the comment to remove any mention of
appendable_only and clarify that do_with_segments<R, F>(&self, mut f: F) ->
AbortOnDropHandle<R> iterates over all segments (both appendable and
non-appendable) and does not lock the SegmentHolder during the operation; keep
the rest of the behavior description (e.g., that it performs an operation using
the shard's segments and returns an AbortOnDropHandle) consistent with the
current signature.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@lib/collection/src/shards/local_shard/mod.rs`:
- Around line 982-987: The doc comment for the method do_with_segments still
mentions the removed appendable_only parameter; update the comment to remove any
mention of appendable_only and clarify that do_with_segments<R, F>(&self, mut f:
F) -> AbortOnDropHandle<R> iterates over all segments (both appendable and
non-appendable) and does not lock the SegmentHolder during the operation; keep
the rest of the behavior description (e.g., that it performs an operation using
the shard's segments and returns an AbortOnDropHandle) consistent with the
current signature.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 831cfbb3-a5c4-4640-bbaa-699326365a36

📥 Commits

Reviewing files that changed from the base of the PR and between 8733d9f and daf9c3f.

📒 Files selected for processing (3)
  • lib/collection/src/shards/local_shard/mod.rs
  • lib/shard/src/optimize.rs
  • lib/shard/src/proxy_segment/segment_entry.rs

@generall
generall merged commit 4c41ddf into dev Mar 23, 2026
15 checks passed
@generall
generall deleted the deferred-in-proxy-fix branch March 23, 2026 08:54
@agourlay agourlay added this to the deferred updates milestone Mar 25, 2026
generall added a commit that referenced this pull request Mar 26, 2026
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.

3 participants