Skip to content

Adjust points selection for deferred points update - #8279

Merged
timvisee merged 13 commits into
devfrom
update-delete-points-logic-on-deferred
Mar 9, 2026
Merged

timvisee merged 13 commits into
devfrom
update-delete-points-logic-on-deferred

Conversation

@agourlay

@agourlay agourlay commented Mar 3, 2026 •

Copy link
Copy Markdown
Member

This PR handles deferred points in find_points_to_update_and_delete.

Previously, the deduplication logic did not distinguish between deferred and non-deferred points which could cause possible data loss/inconsistencies later.

The new rules for handling a given point are:

  1. Always update the latest version regardless of deferred status
  2. Never delete deferred points — optimizer handles them
  3. Delete older non-deferred copies only if the latest version is not deferred
  4. Keep older non-deferred copies when the latest is deferred

Changes

  • Move point_is_deferred to NonAppendableSegmentEntry trait and implement for ProxySegment
  • Refactor find_points_to_update_and_delete with new aforementioned rules.

Tests

Mostly AI generated.

  • test_find_points_to_update_and_delete: baseline without deferred points
  • test_find_points_to_update_and_delete_with_deferred: deferred loses to newer non-deferred
  • test_find_points_to_update_and_delete_with_deferred_only: deferred-only point with no non-deferred copy
  • test_find_points_to_update_and_delete_with_deferred_winning: deferred wins when strictly newer than non-deferred

Future work

Handle copy on write on update operation (#8290)

@agourlay agourlay added this to the deferred updates milestone Mar 3, 2026
@agourlay
agourlay force-pushed the update-delete-points-logic-on-deferred branch 4 times, most recently from 1a834cf to e0fd273 Compare March 3, 2026 15:34
@agourlay
agourlay marked this pull request as ready for review March 3, 2026 15:36
@agourlay
agourlay requested a review from Copilot March 3, 2026 15:44
coderabbitai[bot]

This comment was marked as resolved.

This comment was marked as resolved.

@agourlay
agourlay force-pushed the update-delete-points-logic-on-deferred branch from 333ab97 to 3793695 Compare March 4, 2026 09:34
coderabbitai[bot]

This comment was marked as resolved.

@agourlay
agourlay requested a review from timvisee March 4, 2026 11:35
Comment thread lib/shard/src/segment_holder/mod.rs Resolved

@timvisee timvisee left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Some raw comments 😃

Comment thread lib/shard/src/segment_holder/mod.rs Resolved
Comment thread lib/shard/src/segment_holder/mod.rs Resolved
Comment thread lib/shard/src/segment_holder/mod.rs Resolved
Comment thread lib/shard/src/segment_holder/mod.rs Resolved
Comment thread lib/shard/src/segment_holder/mod.rs Resolved
Comment thread lib/shard/src/segment_holder/mod.rs Resolved
coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

@agourlay

agourlay commented Mar 5, 2026

Copy link
Copy Markdown
Member Author

I believe I applied all comments, including:

  • not deleting old deferred version
  • performing a single pass
  • staying close to the original implementation

coderabbitai[bot]

This comment was marked as resolved.

@agourlay
agourlay force-pushed the update-delete-points-logic-on-deferred branch from d34db75 to 26fdc91 Compare March 5, 2026 19:29
@IvanPleshkov
IvanPleshkov force-pushed the update-delete-points-logic-on-deferred branch from 26fdc91 to 77d4091 Compare March 8, 2026 17:00
@qdrant qdrant deleted a comment from coderabbitai Bot Mar 9, 2026
@timvisee
timvisee merged commit 43b94d2 into dev Mar 9, 2026
16 checks passed
@timvisee
timvisee deleted the update-delete-points-logic-on-deferred branch March 9, 2026 09:05
@IvanPleshkov IvanPleshkov mentioned this pull request Mar 9, 2026
2 tasks done
generall pushed a commit that referenced this pull request Mar 26, 2026
* Adjust points selection for deferred points update

* adjust proxy segment implementation

* clean

* simplify

* use simpler proxy impl

* cleanup

* stick to Entry API

* renaming to stay closer to the original

* renaming to stay closer to the original

* nits

* two passes and simpler impl.

* fmt

* fmt

---------

Co-authored-by: Ivan Pleshkov <[email protected]>
KShivendu pushed a commit that referenced this pull request Mar 30, 2026
* Adjust points selection for deferred points update

* adjust proxy segment implementation

* clean

* simplify

* use simpler proxy impl

* cleanup

* stick to Entry API

* renaming to stay closer to the original

* renaming to stay closer to the original

* nits

* two passes and simpler impl.

* fmt

* fmt

---------

Co-authored-by: Ivan Pleshkov <[email protected]>
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.

5 participants