jackrabbit-oak icon indicating copy to clipboard operation
jackrabbit-oak copied to clipboard

OAK-10812: DocumentNodeStore#diffManyChildren(...) may produce incorr…

Open mbaedke opened this issue 1 year ago • 7 comments

…ect results in readonly mode

Added test case.

mbaedke avatar May 16 '24 14:05 mbaedke

Preliminary test. Please review if it makes any sense.

mbaedke avatar May 16 '24 14:05 mbaedke

Potential fix: if in DocumentNodeStore#getMinExternalRevisions() we replace getClusterId() - which is 0 in readonly mode - with the configured cluster id, the problem disappears.

mbaedke avatar May 16 '24 16:05 mbaedke

I'm wondering if that wouldn't introduce a regression elsewhere .. there must have been a reason this was set to 0 for read-only?

stefan-egli avatar May 16 '24 16:05 stefan-egli

@stefan-egli , I understand that it's not supposed to collide with a simultaneously running read-write node. The proposal is not to change the cluster id, but to add an additional property to store the configured cluster id. That would probably not cover all scenarios, though, because the real cluster id may differ from the configured one.

mbaedke avatar May 17 '24 07:05 mbaedke

(maybe we could add a test case to reproduce real being different than configured id - and then the result might be two additional properties would be required, real and configured..)

stefan-egli avatar May 21 '24 15:05 stefan-egli

@stefan-egli , see ticket for an explanation.

mbaedke avatar May 29 '24 11:05 mbaedke

PS: commented on the ticket

stefan-egli avatar Jun 06 '24 16:06 stefan-egli

@mbaedke adding a check to handle the case where fromRev.pmin(minRevisions) results in an empty vector could fix the issue

ionutzpi avatar Jul 31 '24 14:07 ionutzpi