iskenderurs opened a new pull request, #8941: URL: https://github.com/apache/hadoop/pull/8941
### Description of PR [HDFS-18022](https://issues.apache.org/jira/browse/HDFS-18022) After `discardSegments`, JournalNode can still return discarded transactions through its in-memory RPC edits cache. An asynchronously tailing NameNode can therefore replay edits deliberately removed by rolling-upgrade rollback. Reset the cache and highest-readable transaction ID only after the on-disk discard succeeds, and abort a discarded in-progress segment. Readers snapshot the cache and high-water mark together under the Journal monitor; response serialization stays outside that monitor. Retained edits remain available through the existing disk fallback after a cache miss. No configuration or protocol changes. ### How was this patch tested? Based on Apache Hadoop trunk `c815ec8e1e98f20e3f0ae2637665d4adb9196660`. * `TestJournal`: **19 tests passed, 0 failures/errors/skips**, JDK 17 on macOS, pure Java MiniJournalCluster. * Checkstyle 11.1.0 with the repository configuration: no violations on changed lines (five existing violations in the selected files). * Three added cases cover finalized-segment discard, in-progress discard with reused transaction IDs, and rejected mid-segment discard preserving the cache. * Before the fix, both valid-discard reproducers fail: the journal reports highest TXID 6 after discarding from 4, instead of 3. These were independently reproduced without the experimental Multi-DC changes. * Additional local HA integration exercised rollback with warm JournalNodes and RPC tailing, checking that the removed namespace entry stays absent after promotion and restart. The committed unit regression remains independent of those experimental fixtures. ```sh mvn -pl hadoop-hdfs-project/hadoop-hdfs -am test \ -Dtest=TestJournal -Dsurefire.failIfNoSpecifiedTests=false \ -DfailIfNoTests=false -Dmaven.test.failure.ignore=false ``` This patch concerns namespace edit visibility after administrative rollback; it does not add any new block durability or failover guarantee. Linux/native and distributed-cluster qualification remain for CI and subsequent testing. ### For code changes: - [x] Does the title of this PR start with the corresponding JIRA issue id? - Object storage integration tests: not applicable. - New dependencies / dependency licensing: not applicable; none added. - LICENSE / NOTICE updates: not applicable. ### AI Tooling Contains content generated by OpenAI Codex. - [x] The PR includes the required AI tooling disclosure. - [x] My use of AI contributions follows the ASF legal policy https://www.apache.org/legal/generative-tooling.html -- 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]
