shubhamranjan opened a new pull request, #4624:
URL: https://github.com/apache/solr/pull/4624

   https://issues.apache.org/jira/browse/SOLR-18294
   
     # Description
   
   `IndexFetcherPacketProtocolTest` fails intermittently (~5%) with:
   
   `java.lang.AssertionError: fetchPackets return code mismatch expected:<0> 
but was:<1>`
   
   The test writes its sample file into the core index directory obtained with 
`DirContext.DEFAULT`, then has the sender 
(`ReplicationAPIBase.DirectoryFileStream`) serialize it. The sender reads via 
`DirContext.REPLICATION`, which `CachingDirectoryFactory.filterDirectory()` 
resolves through `FilterDirectory.unwrap()` to the raw delegate. Under the 
randomized test `DirectoryFactory`, a file written through the wrapped 
(`DEFAULT`) view can be invisible through the unwrapped (`REPLICATION`) view, 
so the sender throws `NoSuchFileException`, emits an empty stream, and the 
receiver returns `NO_CONTENT` (`1`) — failing the assertion.
   
   # Solution
   Acquire the directory in the test with the same `REPLICATION` `DirContext` 
the sender uses, so the write and the read target the same delegate 
`Directory`. Test-only change; production replication is unaffected (it serves 
committed, fsync'd segments that are always present on the delegate).
   
   # Tests
   
     - `IndexFetcherPacketProtocolTest` passes.
     - Beasted, including `-Ptests.nightly=true` and 
`-Ptests.directory=ByteBuffersDirectory`, with no failures.
   
   # Checklist
   
     - [x] I have reviewed the guidelines for [How to 
Contribute](https://github.com/apache/solr/blob/main/CONTRIBUTING.md) and my 
code conforms to the standards described there to the best of my ability.
     - [x] I have created a Jira issue and added the issue ID to my pull 
request title.
     - [x] I have developed this patch against the `main` branch.
     - [x] I have run `./gradlew check`.
     - [x] I have added tests for my changes.


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to