New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-1868 properly propagate "clear links" across commit logs. #1871
Conversation
The following situation caused an issue. Imagine there are two commit logs in chronological order: Log 1: - AddLink for Node/Level/Link 0/0/1 - AddLink for Node/Level/Link 0/0/2 Log 2: - ClearLinks for Node/Level 0/0 - AddLink for Node/Level/Link 0/0/3 - AddLink for Node/Level/Link 0/0/4 It should be quite obvious that after reading all the logs back in the correct order node 0 will have the connections [3,4] at level zero, as there was a "clear" event in between. However, prior to this fix we would have ended up with [1,2,3,4] because the clear information got lost when condensing each log independently. This fix makes sure that information that relates to changes from prior commit logs is kept when condensing a commit log. The actual bug was when reading (as part of condensing) as we used the clear only to clear the links (which from the perspective of log 2 were already empty). This led us to condensing log 2 to just "add 3, add 4", whereas the correctly condensed log would have been "clear, add 3, add 4". This is the case now. To write the tests needed for this fix, it was required to add some functional options to the commit logger to control the commit log size thresholds. As of now these are not yet exposed to the user, but this would also add value. fixes #1868 Potential follow-up tasks: 1. Expose Commitlog configuration (e.g. thresholds) to user, so they can finetune them to their needs 2. Clean up the redundant and partly unused code, and the confusion between condensor/condensor2 and deserializer/deserializer2
Codecov Report
@@ Coverage Diff @@
## master #1871 +/- ##
==========================================
+ Coverage 66.27% 66.37% +0.09%
==========================================
Files 415 418 +3
Lines 31433 31740 +307
==========================================
+ Hits 20833 21068 +235
- Misses 8792 8846 +54
- Partials 1808 1826 +18
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Update: This has been addressed and this PR should be ready to be reviewed/merged. |
This should also fix the flaky test seen on this PR's CI
The following situation caused an issue. Imagine there are two commit
logs in chronological order:
Log 1:
Log 2:
It should be quite obvious that after reading all the logs back in the
correct order node 0 will have the connections [3,4] at level zero, as
there was a "clear" event in between.
However, prior to this fix we would have ended up with [1,2,3,4] because
the clear information got lost when condensing each log independently.
This fix makes sure that information that relates to changes from prior
commit logs is kept when condensing a commit log. The actual bug was
when reading (as part of condensing) as we used the clear only to clear
the links (which from the perspective of log 2 were already empty). This
led us to condensing log 2 to just "add 3, add 4", whereas the correctly
condensed log would have been "clear, add 3, add 4". This is the case
now.
To write the tests needed for this fix, it was required to add some
functional options to the commit logger to control the commit log size
thresholds. As of now these are not yet exposed to the user, but this
would also add value.
fixes #1868
Potential follow-up tasks:
finetune them to their needs
between condensor/condensor2 and deserializer/deserializer2