[
https://issues.apache.org/jira/browse/HDFS-17850?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18063921#comment-18063921
]
ASF GitHub Bot commented on HDFS-17850:
---------------------------------------
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`) ✅
> During append, it is necessary to verify whether the same GS exists in the
> datanode.
> ------------------------------------------------------------------------------------
>
> Key: HDFS-17850
> URL: https://issues.apache.org/jira/browse/HDFS-17850
> Project: Hadoop HDFS
> Issue Type: Improvement
> Reporter: TangLin
> Priority: Major
>
> When using a third-party HDFS client, if there is a problem with the client
> logic and append does not update the GS, HDFS may report corrupted replicas.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]