-
Notifications
You must be signed in to change notification settings - Fork 44
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
refactor: Merkle clock heads cleanup #918
Merged
Merged
Conversation
This file contains 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
AndrewSisley
added
area/crdt
Related to the (Merkle) CRDT system
refactor
This issue specific to or requires *notable* refactoring of existing codebases and components
action/no-benchmark
Skips the action that runs the benchmark.
labels
Oct 26, 2022
Add is a poor name, and adds an extra layer of misdirection.
Is only called from here, and the caller to this function knows that this row exists, so we will never actually hit the isNotFound error allowing it to be safely dropped.
Old names unhelpful and the distinction was easily missed resulting in a bug (caught by tests).
Is only called once, and the unfactoring allows for future refactorings
Error would have been way up the callstack where ever height was declared, and it is on those funcs to make sure it fits whatever constraints they may have.
Is also potentially misleading as the cid's location in the key is dependent on the index format, not the code in this file/package
AndrewSisley
force-pushed
the
sisley/feat/I849-heads-refactor
branch
from
October 26, 2022 19:24
af48e5d
to
cd604de
Compare
This optimization should be handled by the index, not the scan code. It also produces undesirable errors which have been corrected in this commit.
AndrewSisley
force-pushed
the
sisley/feat/I849-heads-refactor
branch
from
October 26, 2022 19:27
cd604de
to
50b7193
Compare
Codecov Report
@@ Coverage Diff @@
## develop #918 +/- ##
===========================================
- Coverage 59.90% 59.82% -0.08%
===========================================
Files 159 159
Lines 17391 17335 -56
===========================================
- Hits 10418 10371 -47
+ Misses 6044 6038 -6
+ Partials 929 926 -3
|
fredcarle
reviewed
Oct 27, 2022
fredcarle
approved these changes
Oct 27, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
shahzadlone
pushed a commit
to shahzadlone/defradb
that referenced
this pull request
Feb 23, 2024
* Remove commented out code * Remove dead code (Len) * Remove unnessecary var declaration * Remove unessecary func param * Remove extra Add func Add is a poor name, and adds an extra layer of misdirection. * Remove extra delete func Is only called from here, and the caller to this function knows that this row exists, so we will never actually hit the isNotFound error allowing it to be safely dropped. * Rename func params Old names unhelpful and the distinction was easily missed resulting in a bug (caught by tests). * Unfactor IsHead Is only called once, and the unfactoring allows for future refactorings * Remove unused return param * Use Has instead of Get+IsError * Remove private constructor * Remove incorrect error Error would have been way up the callstack where ever height was declared, and it is on those funcs to make sure it fits whatever constraints they may have. * Remove unhelpful comment Is also potentially misleading as the cid's location in the key is dependent on the index format, not the code in this file/package * Remove cid-based shortcut This optimization should be handled by the index, not the scan code. It also produces undesirable errors which have been corrected in this commit.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
action/no-benchmark
Skips the action that runs the benchmark.
area/crdt
Related to the (Merkle) CRDT system
refactor
This issue specific to or requires *notable* refactoring of existing codebases and components
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.
Relevant issue(s)
Part of #849
Description
I cleaned up the code a bit as part of #849 however I have hit another snag (unrelated to these changes) and will need to think more. I consider these commits to be a desirable improvement in there own right and it could be good to get them in earlier (it will also shrink the feature PR when it comes along).