bhabegger opened a new pull request, #2953:
URL: https://github.com/apache/jackrabbit-oak/pull/2953

   Follow-up to #2938 addressing the cascade-delete regression flagged in bot 
review.
   
   ## Problem
   
   `deleteDocuments(path)` in `DefaultIndexWriter` issues two Lucene deletes:
   the exact path term and a `PrefixQuery(path + "/")` that sweeps all 
descendants.
   The mixin-removal branch in `FulltextIndexEditor.leave()` was calling this 
method,
   so when a parent node lost its mixin, all child nodes that still carried the 
mixin
   were evicted from the index.
   
   ## Fix
   
   Split `FulltextIndexWriter` into two explicit operations:
   
   | Method | Semantics | When to use |
   |--------|-----------|-------------|
   | `deleteDocumentTree(path)` | node + all descendants | node physically 
removed |
   | `deleteDocument(path)` | exact node only | node lost indexability at 
runtime |
   
   `FulltextIndexEditor.leave()` now calls `deleteDocument` in the 
`toBeDeleted` branch.
   
   The toggle snapshot (`mixinTrackingEnabled`) is taken once in `enter()` so 
that
   `enter` and `leave` always agree even if the kill switch is flipped 
mid-cycle.
   
   All backends (Lucene, Elastic) and NRT stubs implement both methods 
explicitly
   (no default fallback — each implementor is forced to be deliberate).
   
   ## Test
   
   
`PropertyIndexCommonTest#parentLosesMixinDoesNotCascadeDeleteChildWithSameMixin`
   — parent loses `mix:title`, child retains it, child must survive in query 
results.
   
   Verified: 1245 tests, 0 failures in oak-lucene.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to