You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-dev@jackrabbit.apache.org by "bhabegger (via GitHub)" <gi...@apache.org> on 2026/06/12 08:06:19 UTC
[PR] OAK-12244: fix cascade delete when node loses mixin indexability [jackrabbit-oak]
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: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-12244: fix cascade delete when node loses mixin indexability [jackrabbit-oak]
Posted by "thomasmueller (via GitHub)" <gi...@apache.org>.
thomasmueller merged PR #2953:
URL: https://github.com/apache/jackrabbit-oak/pull/2953
--
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: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org