-
Notifications
You must be signed in to change notification settings - Fork 51
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
fix: Remove duplication of block heads on delete #3096
fix: Remove duplication of block heads on delete #3096
Conversation
Note how the most recent commit has two heads! I'm too lazy to bother including the cids, but both links are identical and point to the create composite.
They are added later in MerkleClock.AddDelta - the removed code was just doubling them up.
Now we no longer need to store const string values in the blocks
ee9b955
to
b30a7bc
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #3096 +/- ##
===========================================
+ Coverage 79.71% 79.79% +0.08%
===========================================
Files 351 351
Lines 27358 27335 -23
===========================================
+ Hits 21806 21810 +4
+ Misses 4001 3984 -17
+ Partials 1551 1541 -10
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 7 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
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.
Looks good, Andy. A huge thanks for good comments you left for block fields. Very helpful.
testUtils "github.com/sourcenetwork/defradb/tests/integration" | ||
) | ||
|
||
func TestQueryCommits_WithDelete(t *testing.T) { |
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.
nitpick: the test name is not quite descriptive. Had to read the test's body in order to understand what it tests.
Wouldn't something like TestQueryCommits_AfterDocDeletion_ShouldStillFetch
fit better?
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.
I see what you mean, thanks Islam :)
- Rename test
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.
Thanks for all the documentation and the removal of C
haha LGTM
// This field currently serves no purpose and is duplicating data already held on the target | ||
// block. However we want to have this long term to enable some fancy P2P magic to allow users | ||
// to configure the collection to only sync particular fields using | ||
// [GraphSync](https://github.com/ipfs/go-graphsync) which will need to make use of this property. |
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.
suggestion: You could just say that this field is needed for graphSync and sync optimisation instead of (not sure this was you intention but this is what I get from this) showing through the comment that you are annoyed that the field is still there.
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.
No intended annoyance in the wording, I do feel that it is important to note that the current lack of purpose is known and somewhat deliberate though otherwise people (including future me) will assume the lack of purpose is accidental and try and remove it,
Relevant issue(s)
Resolves #3085 #3089
Documents #3056 #3086 #3087 (I'm going to close these on merge, no need to have them littering the backlog)
Description
Removes the duplication of head links from delete blocks.
PR also includes the following to save the hassle of multiple test-cid updates:
fieldName
from composite block deltas_head
link name, and extracts head links to a new, optional propWith the actions defined in
TestQueryCommitsWithFieldIDFieldWithUpdate
, create block size has been reduced by 4%, and update block size by 7% - this will vary a lot depending on what fields are being updated though, the test chosen to calc was just the first test I found that created one small doc, and updated a single field.I recommend reviewing commit by commit. The test-cid changes have been pulled out to their own commit.