Fix two bugs around the handling of child nodes of a deleted parent#352
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## v0.17.x #352 +/- ##
===========================================
- Coverage 86.46% 86.42% -0.04%
===========================================
Files 22 22
Lines 3465 3477 +12
===========================================
+ Hits 2996 3005 +9
- Misses 469 472 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
d2ad562 to
7dd991c
Compare
[Why] We document that the result explicitly lists all deleted tree nodes, whether directly by a command or indirectly through a `keep_while` condition to the result map. This should include children of top-level deleted nodes as well. [How] Recursively add all children of a deleted tree node to the result map.
[Why] This map is used for various tasks. One of them is the cleanup of `keep_while` conditions and the associated reverse index. Before this commit, entries were leaked in the reverse index because only the parent was taken care of.
[Why] There were two bugs caused by the lack of handling of child tree nodes implicitly deleted with their parent: * Child nodes were missing from the result map. * Child nodes deleted because of a parent's `keep_while` expiring were not fully handled. This led to a leak of child nodes' `keep_while` conditions in the reverse index. [How] The new test cases cover both bugs. We introduce two new helpers to implement this test: * `khepri_machine:get_keep_while_conds_revidx/1 to query the `keep_while` conditions reverse index. * `khepri_tree:unopacify/1` to be able to compare opaque reverse indices with expected values in test cases. Each test case correspdons to a version of the machine, and thus a specific implementation of the reverse index.
7dd991c to
c499365
Compare
Contributor
|
Can/should we produce a new |
Collaborator
Author
|
It will go together with related changes in Horus and RabbitMQ. I don’t remember the date for RabbitMQ 4.2.3, so not sure it will be ready if it is about to be released. |
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.
There were two bugs caused by the lack of handling of child tree nodes implicitly deleted with their parent:
keep_whileexpiring were not fully handled. This led to a leak of child nodes'keep_whileconditions in the reverse index.See each commit for the full explanation.
The third commit introduces test cases to verify both bug fixes.