-
Notifications
You must be signed in to change notification settings - Fork 410
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
OAK-10875 - unmerged bc on root can make it appear merged #1605
Conversation
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 think the fix should contain 2 main parts:
-
put the repository back into a state where things a proper, in case of a OAK-10875 style "inconsistency". For that I think removing the
_commitRoot
could be a part of it. Added more details to alternatives in the commend below (we could also not remove neither_commitRoot
nor_bc
). -
as a second part though, we'd also have to handle cases where the inconsistency is already done and it's too late to clean up, as we've gone passed that moment (recovery was already done, unmerged bcs already removed). For this I think there could be two sub options:
2a. introduce a type of purgeUnmergedRevisions where we are able to clean up such an inconsistency even if it happened months ago (before the fix we want to introduce here), and thus the _bc
is already gone. If this were possible, that would be nice, I think.
2b. make the "commit value resolving code" (which is spread over several classes) aware of this type of inconsistency and handle it properly. So that we wouldn't depend on a cleanup.
- I'm thinking FullGC might also have to be made capable - or could be made capable - of cleaning up this inconsistency. Perhaps as alternative to 2a.
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/NodeDocument.java
Outdated
Show resolved
Hide resolved
Also it might be good to modify the original test to have 2 kinds of tests:
(perhaps we can come up with a test that ensures that a property created as unmerged bc on root is never treated as committed - even though it is passed sweep rev and no branch commit info is remaining) |
For the first part I removed the unmerged revision from _commitRoot(I think this is the proper fix to solve the bug). |
What about splitting the two parts, as you suggested, into two different PRs? I would tend to prefer if OAK-10875 would stay open as I believe both parts are required? But they could certainly be split into two PRs to simplify things. Wdyt? Btw: there's something odd going on with this PR as it seems to duplicate the original : eg unmergedBCOnRoot is already there in trunk, but this PR adds it again, same with the changes of FailingDocumentStore. The CI currently complains with
I think originally the PR was complaining it can't merge due to these duplications - now it doesn't do that anymore. No idea why... |
Yes. We can have 2 PR for this ticket. The first part can be reviewed. I added a test method for the case where we have unmergedBC but no property set on root in the same BC(it didn't failed). |
looks like there's some remaining merge conflict |
It is fine now. |
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'd have one suggestion for consideration, otherwise looking good.
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/NodeDocument.java
Outdated
Show resolved
Hide resolved
oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/BranchTest.java
Outdated
Show resolved
Hide resolved
waiting for tests to succeed (or only have unrelated flakyness) before approving/merging next |
failure seems unrelated :
|
If an oak instance crashes during a branch commit, which in turns leaves the bc unmerged - and that branch contained changes on root - it can later result in that unmerged bc to be considered as merged. If that values is then cached before other changes of the branch are read, those other changes are then considered merged even though they never have.