Repository navigation
Always delete old point versions when applying point operation - #5962
Merged
Merged
Conversation
timvisee
force-pushed
the
apply-point-delete-old-versions
branch
from
February 10, 2025 16:50
4a561d4 to
60e29e3
Compare
timvisee
commented
Feb 10, 2025
Comment on lines
+591
to
+600
| // Delete old points first | ||
| for (segment_id, points) in to_delete { | ||
| let segment = self.get(segment_id).unwrap(); | ||
| let segment_arc = segment.get(); | ||
| let mut write_segment = segment_arc.write(); | ||
|
|
||
| for point_id in points { | ||
| point_delete_operation(point_id, &mut write_segment)?; | ||
| } | ||
| } |
Member
Author
There was a problem hiding this comment.
Here we now delete older versions before applying operations to the newest point version.
| /// selected to be updated, all older versions are marked to be deleted. | ||
| /// | ||
| /// Points that are already soft deleted are not included. | ||
| fn find_points_to_update_and_delete( |
Member
Author
There was a problem hiding this comment.
Function is adjusted to now collect both the latest point versions, and all older point versions.
timvisee
marked this pull request as ready for review
February 10, 2025 17:07
2 of 13 tasks
generall
reviewed
Feb 11, 2025
generall
reviewed
Feb 11, 2025
generall
reviewed
Feb 11, 2025
timvisee
force-pushed
the
apply-point-delete-old-versions
branch
from
February 11, 2025 12:59
4d1c56c to
ebed617
Compare
Co-authored-by: Andrey Vasnetsov <[email protected]>
timvisee
force-pushed
the
apply-point-delete-old-versions
branch
from
February 11, 2025 13:01
ebed617 to
fcf1058
Compare
generall
approved these changes
Feb 11, 2025
timvisee
added a commit
that referenced
this pull request
Feb 11, 2025
* Always delete old point versions when applying point operation * Add helper struct for updates/deletes, make selection more readable * Cleanup * Add debug assertion * If having multiple point versions, delete first, then apply operations * Deleted old points with their existing point version, extend test * Don't delete other points with the same version for now, add test case * Remove helper struct since updates and deletes are separated again * Smarter capacity estimate * apply change to all points with latest version * Use small vec extra allocations * Eliminate delete closure, delete internally and pass hardware counter * Update comment Co-authored-by: Andrey Vasnetsov <[email protected]> --------- Co-authored-by: Andrey Vasnetsov <[email protected]>
This was referenced Feb 11, 2025
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Continuation after #5956 as suggested by #5956 (comment).
An initial implementation for always deleting older point versions when an operation is applied. It cleans up duplicate points and prevents users retrieving old point data.
This is a first iteration, and I'm not super happy with the implementation yet. However, it is good enough to be included in a patch release.
This PR has the following properties:
In a future PR I'd like to change these properties to:
However, implementing these extra changes appears to be entirely non trivial. Naively implementing it makes many weird problem appear, such as losing points if we have multiple proxies using the same write segment.
I've added a test and adjusted an existing test to assert correct behavior of this change.
All Submissions:
devbranch. Did you create your branch fromdev?New Feature Submissions:
cargo +nightly fmt --allcommand prior to submission?cargo clippy --all --all-featurescommand?