balodesecurity opened a new pull request, #8320:
URL: https://github.com/apache/hadoop/pull/8320
## Summary
Fixes a subtle bug where `FsDatasetImpl.append()` accepted a `newGS` equal
to the replica's current generation stamp. The invariant for any append is that
the new generation stamp must be *strictly* greater than the existing one;
allowing `newGS == currentGS` permits a misbehaving client to re-use the same
GS and corrupt replica state silently.
### Changes
- `FsDatasetImpl.java`: Change `newGS < b.getGenerationStamp()` to `newGS <=
b.getGenerationStamp()` (one character change).
- `TestFsDatasetImpl.java`: Add `testAppendRejectsSameGenerationStamp` which
asserts:
- `newGS == currentGS` throws IOException
- `newGS < currentGS` throws IOException (pre-existing behavior)
- `newGS > currentGS` succeeds (pre-existing behavior)
## Test plan
- [ ] `TestFsDatasetImpl#testAppendRejectsSameGenerationStamp` passes
locally ✅
- [ ] Full module build passes (`mvn package -pl
hadoop-hdfs-project/hadoop-hdfs -am -DskipTests`) ✅
--
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]