Repository navigation
HDFS-17960. Fix snapshot count mismatch during edit log replay - #8672
Conversation
szetszwo
left a comment
There was a problem hiding this comment.
+1 the change looks good.
Hi @szetszwo, it seems no other reviewers have concerns. Could you help merge it? Thanks! |
|
@JHSUYU , there are some failures. Rerunning it. |
Thanks! Let me know if there is anything else I need to do |
|
@JHSUYU , it failed the second time. Could you take a look? |
|
@szetszwo This seems to be an infrastructure failure: the Jenkins agent hadoop16 disconnected during SCM checkout. I I tested the patch locally against the latest trunk, and everything seems good. I’m not sure if this is a Jenkins issue. Do you think rerunning it would solve the problem? |
|
Hi @szetszwo , let me know if there is anything else I can do |
|
@JHSUYU , could you push a commit to sync with trunk? See if it could pass jenkins. |
c0d22fa to
0968d68
Compare
|
@szetszwo I synced the PR branch with the latest trunk as requested. Jenkins build failed again during SCM checkout because the hadoop16 agent became unresponsive (Ping timeout / Channel$OrderlyShutdown / |
0968d68 to
f68ec54
Compare
|
Jenkins is unstable; GitHub Actions results can serve as a reference. |
Thanks. GitHub Actions have passed. @pan3793 |
|
🎊 +1 overall
This message was automatically generated. |
|
@JHSUYU , we finally got all +1 from yetus! |
Thanks for the review! |
Description of PR
This PR fixes HDFS-17960.
When edit logs generated with ordered snapshot deletion enabled are replayed with ordered deletion disabled, multiple delete records may refer to the same snapshot. After the first record removes the snapshot
DirectorySnapshottableFeature.removeSnapshot()returnsnullfor a later duplicate record.SnapshotManager.deleteSnapshot()previously ignored this return value and unconditionally decrementednumSnapshots. This caused the counter to differ from the snapshots actually present in the namespace. A subsequent checkpoint could fail while serializing the snapshot section because the number of serialized snapshots did not matchnumSnapshots.This change decrements
numSnapshotsonly whenremoveSnapshot()actually returns a removed snapshot.How was this patch tested?
This PR extends the existing ordered snapshot deletion restart test to verify:
saveNamespace()can successfully create a checkpoint.For code changes:
(e.g. 'HADOOP-17799. Your PR title ...')?
snapshot handling.
AI Tooling
If an AI tool was used:
https://www.apache.org/legal/generative-tooling.html