-
Notifications
You must be signed in to change notification settings - Fork 360
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
Make objects deleted in the same branch that created them continue to show up in older commits (#997) #1000
Conversation
…verse/lakeFS into 945-sstable-tree-interfaces
Co-authored-by: itaiad200 <itaiad200@gmail.com>
…e/lakeFS into feature/rocks-catalog-interface
945 sstable interface
# Conflicts: # forest/sstable/sstable.go
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.
Please rebase your branch on master
. Right now there are 35 commits in this branch, which makes it hard to review each commit separately.
I do not understand this commit well enough to approve it. OTOH, I am therefore unequally unqualified to say that it is safe and does not break other behaviours.
} | ||
return unionMap | ||
} | ||
|
||
func selectSingleBranch(branchID int64, isBaseBranch bool, branchBatchSize int, topCommitID CommitID, prefixLen int, endOfPrefixRange string) sq.SelectBuilder { | ||
rawSelect := sq.Select("branch_id", "min_commit"). | ||
func selectSingleBranch(branchID int64, branchBatchSize int, topCommitID CommitID, prefixLen int, endOfPrefixRange string) sq.SelectBuilder { |
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.
Please document the function with these parameters. The action of this function is confusing.
} | ||
return unionMap | ||
} | ||
|
||
func selectSingleBranch(branchID int64, isBaseBranch bool, branchBatchSize int, topCommitID CommitID, prefixLen int, endOfPrefixRange string) sq.SelectBuilder { | ||
rawSelect := sq.Select("branch_id", "min_commit"). | ||
func selectSingleBranch(branchID int64, branchBatchSize int, topCommitID CommitID, prefixLen int, endOfPrefixRange string) sq.SelectBuilder { |
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.
Also I don't understand the action of parameter isBaseBranch
, why we needed it, and why we no longer do. I don't want to expose some bug that caused that parameter, and it is getting hard for me to track.
I can see that isBaseBranch
used to change the behaviour of max_commit
. Is an unchanged leftover from changing the min_commit
and max_commit
values?
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.
Fixing the bug here made the code simpler. I found I can have the same behavior on max_commit in the base branch, and all its lineage. That is the reason I happily removed "isBaseBranch". This change has nothing to do with the change to minCommit behavior. I just got smarter :-). As for the other parameters - Which one needs clarification?
Co-authored-by: arielshaqed <ariels@treeverse.io>
Also, can we retitle this? AFAICT it does not "erase the object from all commits from master", see my comments on #997 where I reproduced. The objects are deleted from the listings, but they still exist. We should avoid misinformation. |
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.
The code doesn't pass the test
@@ -120,3 +122,94 @@ func testDeleteEntryCommitAndExpectNotFound(t *testing.T, ctx context.Context, c | |||
t.Fatalf("DeleteEntry() get entry err = %s, want = %s", err, wantErr) | |||
} | |||
} | |||
|
|||
func TestCataloger_DeleteEntryAndCheckItRemainsInCommits(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.
Think you can leave the second test as it cover this one - but it is just me ;)
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.
The previous test is somewhat different, and it covers list by prefix (where a separate bug was fixed)
catalog/mvcc/views.go
Outdated
fmt.Sprintf("min_commit != %d AS is_committed", MinCommitUncommittedIndicator), | ||
"max_commit = 0 AS is_tombstone", | ||
"ctid AS entry_ctid\n", | ||
fmt.Sprintf("max_commit < %d AS is_deleted", MaxCommitID)). | ||
fmt.Sprintf("max_commit < %d AS is_deleted", actualCommit)). |
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.
Use the Column syntax - ex: .Column("min_commit != ? AS is_committed", MinCommitUncommittedIndicator)
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, Fixed them all
Codecov Report
@@ Coverage Diff @@
## master #1000 +/- ##
==========================================
+ Coverage 44.26% 44.27% +0.01%
==========================================
Files 140 140
Lines 11570 11570
==========================================
+ Hits 5121 5123 +2
+ Misses 5799 5797 -2
Partials 650 650
Continue to review full report at Codecov.
|
This comment (missed in the commits) needs to be addressed immediately:
The title of this PR is simply the title of issue #997. That issue was titled without a root-cause analysis, since it came from outside (thanks again, @tsykes-2020, for a really good catch!). To limit further fallout I am changing the PR title unilaterally. @tzahij and others: please feel free to correct the title further as needed! |
fixed in regular and by prefix listing