Repository navigation
Apply point deletions to all point versions - #5956
Conversation
ef8430c to
3992a99
Compare
b6e896e to
ce55f28
Compare
5ebe792 to
fe84bd0
Compare
| // Apply point delete to all point versions | ||
| true, |
There was a problem hiding this comment.
Critical bit: for point delete operations we use true to apply the delete to all point versions.
For other operations this flag is false, meaning it only applies to the latest version as expected.
|
After giving it a bit more though, I have an alternative proposal. Assume we have a situation, where 2 points with different versions already exist (for whatever reason) Option 1 - we update only highest version. Option 2 - we always update both version. So, both approaches are not ideal, but I have another option Option 3 (proposed) - delete old version on update Thoughts? |
Are you suggesting that a payload value on an old point might make the old point appear if we filter on that value? I think you're right. Good thinking!
After another thought, I don't see flush issues. We'll never delete the highest point version, which means we can never lose the point on flush. I like the idea! Are you fine with merging this PR first? So we can consider option 3 after? |
* Extract point in segment selection logic, find just latest or all * Add only_latest_version flag to apply_points * The apply_points_with_conditional_move function does not delete points * Flip boolean, only_latest_version to all_point_versions * Link to GitHub PR describing bug * Add test, assert point delete applies to all point versions * split into two functions * nit: calculate default capacity outside of loop * When deleting point vector, only apply to latest point version --------- Co-authored-by: Luis Cossío <[email protected]>
Fix a critical problem which could result in us reviving (partial) already deleted points.
A point may exist in multiple segments, having multiple versions. This is normal behavior and can happen due to a myriad of reasons.
Normally, point operations are only applied to the latest point version. This is done on purpose, so that any copy-on-write operation always uses the latest point data as source.
The problem is in deleting points though. If we only delete the latest point version, we may leave older point versions behind. We never use these older versions, but we might now accidentally revive them if we forget the newer deleted version. To prevent this problem, we now delete all point versions.
To accommodate this change, I've extracted the point/segment selection logic into a separate function. It takes care of either selecting all point versions, or just the latest.
All Submissions:
devbranch. Did you create your branch fromdev?New Feature Submissions:
cargo +nightly fmt --allcommand prior to submission?cargo clippy --all --all-featurescommand?Changes to Core Features: