mihaibercea commented on PR #3258: URL: https://github.com/apache/jackrabbit-oak/pull/3258#issuecomment-6578847786
## Issue [OAK-12496](https://issues.apache.org/jira/browse/OAK-12496) An out-of-band import can fail after installing a new definition on a temporary async lane but before completing catch-up. A missing target-lane checkpoint is one such failure. The incomplete definition and generated Elasticsearch resources can remain after the import fails. ## Proposed fix - Track original definitions, import-owned committed states, and completed paths in the shared importer. - Recover incomplete new definitions only when ownership/concurrency checks pass. - Restore existing definitions only before imported data has been committed; explicitly retain and report incomplete replacements requiring recovery. - Preserve completed lane imports and propagate the original import failure, attaching cleanup failures as suppressed exceptions. - Add a default backend cleanup hook. Elasticsearch cleanup checks repository references and alias ownership before deleting the exact generated index. Repository-contained index data does not require direct shared-blob deletion. - Reuse one Elasticsearch connection for import editing and recovery. - Report missing checkpoints explicitly and correct import-state updates. Recovery is enabled by default and can be disabled with `-Doak.index.importer.recoverFailedImport=false`. This is in-process recovery, not persistent crash/restart recovery or complete rollback of existing-index replacements. ## Validation The focused Maven package reactor passed, including: | Test | Passed | |---|---:| | IndexImporterTest | 19 | | IndexImporterRecoveryTest | 14 | | ElasticIndexImporterTest | 20 | | ElasticIndexImporterSupportTest | 2 | | Total | 55 | ```sh mvn -B -ntp \ -pl oak-core,oak-search-elastic,oak-run-elastic -am package \ -Dtest=IndexImporterTest,IndexImporterRecoveryTest,ElasticIndexImporterTest,ElasticIndexImporterSupportTest \ -Dsurefire.failIfNoSpecifiedTests=false \ -Dcheckstyle.skip \ -Drat.skip=true ``` An isolated live test invoked the packaged Oak importer directly and verified automatic removal of the new definition, exact backing index, and exclusive alias before manual test cleanup. The original missing-checkpoint error propagated with exit code 1. Other top-level index identities and lane assignments matched the pre-test baseline. `git diff --check` passes. The full unfiltered suite and Checkstyle/RAT validation have not been run; final downstream package/image integration is separate work. -- 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]
