Rishabh Daim created OAK-12531:
----------------------------------

             Summary: Full GC commit-root cleanup loses cross-cluster child 
visibility
                 Key: OAK-12531
                 URL: https://issues.apache.org/jira/browse/OAK-12531
             Project: Jackrabbit Oak
          Issue Type: Bug
            Reporter: Rishabh Daim
            Assignee: Rishabh Daim


Full GC can propose removing commit metadata that is still needed to 
reconstruct a node's child view. With embedded verification enabled, cleanup is 
rejected even though the current user-property values are unchanged.

h3. Affected behavior
Reproduced with oak-run 1.84.0 and the unmodified 2.8.0 release using Full GC 
mode 6 (ORPHANS_EMPTYPROPS_KEEP_ONE_ALL_PROPS), dryRun=true and verify=true. 
The warning is {{removeGarbage.verify : verifyViaTraversedState failed}}. 
Candidate revision counts are reported, but the rejected document is not 
updated.

h3. Diagnosis
Local dry-run instrumentation of the exact 2.8.0 verifier isolated the mismatch:
* The original document reconstructed directly matches the state obtained by 
traversal.
* Simulated cleanup preserves the current user-property value but removes 
historical {{_commitRoot}} entries from multiple cluster IDs.
* The computed {{DocumentNodeState.getLastRevision()}} vector loses cluster 
components. The stored {{_lastRev}} map is unchanged.
* Child enumeration through the reconstructed state sees fewer children, so 
{{AbstractNodeState.equals}} fails.
* Restoring only the original {{_commitRoot}} entries on an in-memory copy, 
while leaving user-property history pruned, restores the complete child view 
and full state equality. No persistent data was changed for this diagnosis.

{{NodeDocument.createLastRevs()}} derives per-cluster modification revisions 
from both {{_lastRev}} and local {{_revisions}}/{{_commitRoot}} metadata. 
Removing entries solely because they no longer support a retained property 
value can therefore change the revision vector used for descendant reads.

h3. Regression scenario
# Use a synthetic document store with multiple cluster node IDs.
# Create a parent with children written from different cluster nodes and retain 
historical property/commit-root revisions on that parent.
# Arrange for its persisted {{_lastRev}} not to cover every cluster component 
needed for the pre-cleanup child view.
# Advance the clock beyond the Full GC retention window and run mode 6 with 
embedded verification.
# Assert that cleanup preserves the visible subtree and can complete without 
rejecting the parent. Exercise the same scenario with verification disabled to 
detect actual visibility changes rather than relying only on the warning.

Expected: Full GC preserves the metadata required for equivalent child reads 
while pruning obsolete property revisions.
Actual: the proposed commit-root pruning changes the computed revision vector 
and child visibility; verification rejects the update.

A minimal synthetic regression and fix are to be developed on trunk. No 
production document, identifiers, connection details, or raw data are included.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to