Skip to content

Fix apply points mixing point versions, only apply operation to latest - #5528

Merged
timvisee merged 4 commits into
optimization-cancel-inconsistencyfrom
optimization-cancel-inconsistency-apply-points-latest
Nov 27, 2024
Merged

timvisee merged 4 commits into
optimization-cancel-inconsistencyfrom
optimization-cancel-inconsistency-apply-points-latest

Conversation

@timvisee

@timvisee timvisee commented Nov 27, 2024 •

Copy link
Copy Markdown
Member

Potential fix for #5527

Points can be in multiple segments having different versions. We must only apply the operation to the latest version of a point, otherwise our copy on write mechanism may repurpose old point data.

Using the latest point data is very important, because the copy on write operation will bump the version number. If old point data was used, we'll not be able to tell that anymore.

This problem can appear when applying an operation that depends on the current point data (such as set payload), while having a point in multiple segments. Having a point in multiple segments may happen because of optimizations and segment proxies.

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 changed the title Optimization cancel inconsistency apply points latest Fix apply points mixing point versions, only apply operation to latest Nov 27, 2024
@timvisee
timvisee marked this pull request as ready for review November 27, 2024 10:04
@timvisee
timvisee requested a review from generall November 27, 2024 10:04
@timvisee
timvisee changed the base branch from dev to optimization-cancel-inconsistency November 27, 2024 10:07
@timvisee
timvisee merged commit 72366df into optimization-cancel-inconsistency Nov 27, 2024
@timvisee
timvisee deleted the optimization-cancel-inconsistency-apply-points-latest branch November 27, 2024 14:13
generall added a commit that referenced this pull request Nov 27, 2024
* test to demonstrate inconsistency failure during optimization

* Fix apply points mixing point versions, only apply operation to latest (#5528)

* Patch apply points, only apply point operations to latest point version

* Simplify test, we don't need owned strings in JSON macro

* Use ahash in apply points because we map to simple numbers

* Minor improvements

* preserve the update version before doing move_if_exists in proxy (#5531)

* preserve the update version before doing move_if_exists in proxy

* Simplify move_if_exists with flat if statements and early return

* Fix inverted condition, consider deleted if delete is new

* Use hash map keys iterator as more idiomatic Rust

---------

Co-authored-by: timvisee <[email protected]>
Co-authored-by: Tim Visée <[email protected]>

---------

Co-authored-by: Tim Visée <[email protected]>
Co-authored-by: timvisee <[email protected]>
coszio pushed a commit that referenced this pull request Dec 2, 2024
* test to demonstrate inconsistency failure during optimization

* Fix apply points mixing point versions, only apply operation to latest (#5528)

* Patch apply points, only apply point operations to latest point version

* Simplify test, we don't need owned strings in JSON macro

* Use ahash in apply points because we map to simple numbers

* Minor improvements

* preserve the update version before doing move_if_exists in proxy (#5531)

* preserve the update version before doing move_if_exists in proxy

* Simplify move_if_exists with flat if statements and early return

* Fix inverted condition, consider deleted if delete is new

* Use hash map keys iterator as more idiomatic Rust

---------

Co-authored-by: timvisee <[email protected]>
Co-authored-by: Tim Visée <[email protected]>

---------

Co-authored-by: Tim Visée <[email protected]>
Co-authored-by: timvisee <[email protected]>
timvisee added a commit that referenced this pull request Dec 9, 2024
* test to demonstrate inconsistency failure during optimization

* Fix apply points mixing point versions, only apply operation to latest (#5528)

* Patch apply points, only apply point operations to latest point version

* Simplify test, we don't need owned strings in JSON macro

* Use ahash in apply points because we map to simple numbers

* Minor improvements

* preserve the update version before doing move_if_exists in proxy (#5531)

* preserve the update version before doing move_if_exists in proxy

* Simplify move_if_exists with flat if statements and early return

* Fix inverted condition, consider deleted if delete is new

* Use hash map keys iterator as more idiomatic Rust

---------

Co-authored-by: timvisee <[email protected]>
Co-authored-by: Tim Visée <[email protected]>

---------

Co-authored-by: Tim Visée <[email protected]>
Co-authored-by: timvisee <[email protected]>
@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.

1 participant