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

   https://issues.apache.org/jira/browse/OAK-12527
   
   `SegmentTarReader.getBinaryReferences()` threw `Unrecognized magic number` 
when a TAR archive had no `.brf` entry, the same error as for a corrupt one. 
`SegmentArchiveReader` allows `null` for missing binary references, and the 
remote readers already return it.
   
   ## Change
   - `SegmentTarReader.getBinaryReferences()` reads the header of the entry 
after the last segment (its end is known from the index): `<archive>.gph` / 
`.idx` → `null` (missing), `<archive>.brf` → loaded as before and still throws 
if corrupt, any other entry → `IOException`. The `.brf` end comes from its own 
header, so it no longer depends on the graph entry. The method is now 
`@Nullable`.
   - TAR header reading (name, size) moves from `SegmentTarManager` to a new 
`TarEntryHeader`, shared by `SegmentTarReader` and TAR recovery.
   
   ## Tests
   - `TarFileTest`: missing binary references return `null` (also runs for 
Azure and AWS).
   - `SegmentTarReaderTest`: corrupt magic, corrupt data, unexpected entry 
after the last segment.


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