Skip to content

Fix deferred point count across multiple shards - #8496

Merged
agourlay merged 2 commits into
devfrom
fix-deferred-point-count-in-collection-info
Mar 24, 2026
Merged

agourlay merged 2 commits into
devfrom
fix-deferred-point-count-in-collection-info

Conversation

@JojiiOfficial

Copy link
Copy Markdown
Member

This PR fixes accumulation of deferred point counts across multiple shards.

@JojiiOfficial
JojiiOfficial requested a review from agourlay March 24, 2026 11:54
@coderabbitai

coderabbitai Bot commented Mar 24, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d5278e29-a1de-44eb-a8e5-3df215fd3a8d

📥 Commits

Reviewing files that changed from the base of the PR and between bbfc452 and 5f173d2.

📒 Files selected for processing (1)
  • lib/collection/src/collection/collection_ops.rs

📝 Walkthrough

Walkthrough

The change updates Collection::info merge logic to destructure incoming UpdateQueueInfo { length, deferred_points } and, when info.update_queue is already Some, increment both length and deferred_points (initializing deferred_points with a zero-default when needed). Previously only length was accumulated in the Some case while deferred_points was not merged; the None case still assigns info.update_queue = update_queue.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

release:1.17.1

Suggested reviewers

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

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.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 directly relates to the main change: fixing deferred point count accumulation logic across multiple shards, which is exactly what the code change addresses.
Description check ✅ Passed The description accurately describes the changeset - it states the PR fixes accumulation of deferred point counts across multiple shards, which matches the code modifications.

✏️ 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 fix-deferred-point-count-in-collection-info

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.

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@lib/collection/src/collection/collection_ops.rs`:
- Around line 367-371: The current accumulation skips values when
deferred_points is None on the first shard; change the logic in the block
handling deferred_points so that if deferred_points is None but the incoming
update_queue has deferred_points (i.e. update_queue.map(|i|
i.deferred_points).is_some()), you initialize deferred_points to Some(0) before
adding; then always add the incoming value using update_queue.map(|i|
i.deferred_points.unwrap_or_default()).unwrap_or(0) (or equivalent) so
heterogeneous Some/None across shards are correctly accumulated; locate the code
around deferred_points and update_queue in collection_ops.rs and modify that
branch to set deferred_points = Some(0) when needed and then perform the +=
accumulation.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8e243a12-bec9-4027-8414-fa2858df4ee7

📥 Commits

Reviewing files that changed from the base of the PR and between 81f53c9 and bbfc452.

📒 Files selected for processing (1)
  • lib/collection/src/collection/collection_ops.rs

@agourlay agourlay added this to the deferred updates milestone Mar 24, 2026
@agourlay
agourlay merged commit 1a2406d into dev Mar 24, 2026
20 of 21 checks passed
@agourlay
agourlay deleted the fix-deferred-point-count-in-collection-info branch March 24, 2026 12:50
generall pushed a commit that referenced this pull request Mar 26, 2026
* Fix deferred point count across multiple shards

* Count def-points correctly if first shard has no def-points
KShivendu pushed a commit that referenced this pull request Mar 30, 2026
* Fix deferred point count across multiple shards

* Count def-points correctly if first shard has no def-points
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.

2 participants