Skip to content

In proxy segment, apply proxied point delete with its operation version - #5573

Merged
timvisee merged 6 commits into
devfrom
proxy-segment-point-delete-version
Dec 3, 2024
Merged

timvisee merged 6 commits into
devfrom
proxy-segment-point-delete-version

Conversation

@timvisee

@timvisee timvisee commented Dec 3, 2024 •

Copy link
Copy Markdown
Member

At the end of segment optimization, we apply all proxied point deletes to the optimized segment.

When applying these deletes we reused the current segment version on those operations before. The segment likely considers that version to already be persisted. Subsequent flushes will not write the deletes to disk because of it, the segment thinks there are no new changes.

I've changed this to apply the deletes with the operation version that caused the delete to happen. Those will bump the segment version and ensure proper flushing.

I've added a debug assertion to ensure the delete versions are always newer than the segment version.

All Submissions:

  • Contributions should target the dev branch. Did you create your branch from dev?
  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

New Feature Submissions:

  1. Does your submission pass tests?
  2. Have you formatted your code locally using cargo +nightly fmt --all command prior to submission?
  3. Have you checked your code using cargo clippy --all --all-features command?

@timvisee
timvisee requested review from ffuugoo and generall December 3, 2024 10:47
@timvisee
timvisee marked this pull request as draft December 3, 2024 11:04
@timvisee
timvisee force-pushed the proxy-segment-point-delete-version branch from 094d9ae to 98b2a74 Compare December 3, 2024 11:27
optimized_segment.delete_point(version, point_id).unwrap();
}

for deleted_field_name in proxy_deleted_indexes.read().iter() {

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.

We also apply payload index changes here with the same segment version. We should apply the same change to those, using newer operation versions.

I'll do that in a separate PR as it'll require more significant changes, and it is not important for our current chaos testing efforts.

It'll already be fine with this change if there are any deletes.

@timvisee
timvisee marked this pull request as ready for review December 3, 2024 11:31
@timvisee
timvisee requested a review from agourlay December 3, 2024 11:31
@timvisee
timvisee force-pushed the proxy-segment-point-delete-version branch from 72ee618 to b6c7017 Compare December 3, 2024 14:20
Comment on lines +483 to +486
ProxyDeletedPoint {
local_version: op_num,
operation_version: op_num,
},

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.

For explicit delete operations I use op_num for both versions. It prevents moving the point into the write segment through another proxy, if it has a point version in between this local one and this operation.

@timvisee
timvisee requested a review from generall December 3, 2024 14:22
@timvisee
timvisee merged commit 3d3ab62 into dev Dec 3, 2024
@timvisee
timvisee deleted the proxy-segment-point-delete-version branch December 3, 2024 15:37
timvisee added a commit that referenced this pull request Dec 9, 2024
…on (#5573)

* In proxy segment, apply proxied point delete with its operation version

* Also use correct delete version when propagating changes back to wrapped

* Also delete points with version in segment optimizer build new segment

* Track original/operation point versions separately on proxied deletes

* Fix test compilation failures

* Use explicit types when initializing default
@timvisee timvisee mentioned this pull request Dec 9, 2024
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