You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "tballison (via GitHub)" <gi...@apache.org> on 2026/08/20 14:47:13 UTC

[PR] Route FilterDirectory#copyFrom through createOutput (10x backport of #16530) [lucene]

tballison opened a new pull request, #16538:
URL: https://github.com/apache/lucene/pull/16538

   ### Description
   
   Backport to `branch_10x` of the non-breaking parts of #16530 (which itself follows up #16173). Opened ahead of the main merge to get CI on the 10x variant; happy to hold merging until #16530 lands.
   
   #16173 (backported to 10x in 148ee2fd742) changed `FilterDirectory#copyFrom` to delegate to the wrapped directory, which hid `FilterDirectory` subclasses that override `createOutput` for per-file bookkeeping (`TrackingTmpOutputDirectoryWrapper`, `MockDirectoryWrapper`, `NRTCachingDirectory`, `DirectIODirectory`, `ByteWritesTrackingDirectoryWrapper`).
   
   Differences from #16530, since we can't break the API on 10x:
   
   - `Directory#copyFrom` keeps its concrete default implementation (no abstract method, no `copyThroughCreateOutput` helper). `FilterDirectory#copyFrom` routes through `super.copyFrom` — i.e. through `createOutput` — instead of delegating, with javadoc noting that subclasses wanting an optimized copy (e.g. `HardlinkCopyDirectoryWrapper`) may override to delegate.
   - The required implementations added on main (`CompoundDirectory`, `FileSwitchDirectory`, `BaseMergePolicyTestCase`) are unnecessary here and are omitted.
   - `TrackingTmpOutputDirectoryWrapper#copyFrom` failure cleanup uses `IOUtils.deleteFilesIgnoringExceptions` since `deleteFilesSuppressingExceptions` (#14633) is main-only.
   
   Same as #16530:
   
   - Fixes `TrackingTmpOutputDirectoryWrapper#copyFrom` failure cleanup to delete the temp file rather than the logical dest name.
   - Ports the tests: `TestFilterDirectory#testCopyFromRoutesThroughCreateOutput` (replaces `testCopyFromDelegates`), `TestTrackingTmpOutputDirectoryWrapper`, `TestByteWritesTrackingDirectoryWrapper#testCopyFromTracksBytes`, `TestDirectIODirectoryCopyFrom`.
   
   The CHANGES entry replaces the #16173 entry under 10.6.0 Bug Fixes since this reverts that behavior before it ships in a release.
   
   Made with [Cursor](https://cursor.com)


-- 
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: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] Route FilterDirectory#copyFrom through createOutput (10x backport of #16530) [lucene]

Posted by "tballison (via GitHub)" <gi...@apache.org>.
tballison closed pull request #16538: Route FilterDirectory#copyFrom through createOutput (10x backport of #16530)
URL: https://github.com/apache/lucene/pull/16538


-- 
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: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org