HDDS-7137. Add CLI for Getting the failed deleted block txn
What changes were proposed in this pull request?
Supplement CLI for deleted block txn.
- Integrate the related CLI
- Add new CLI to list txns
- Support JSON format file as output and input
- Improve UT
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-7137
How was this patch tested?
UT

Moving the DeletedBlocksTransaction to common hdds.proto is an ideal solution,
but it will lead to the compatibility problem, so I adds the import of ScmServerDatanodeHeartbeatProtocol.proto.
@adoroszlai @ChenSammi PTAL~
Hey @Xushaohong , could you past some example output of this command? For both console output and file output.
Hey @Xushaohong , could you past some example output of this command? For both console output and file output.
@ChenSammi Sure, I screenshotted three pics, and the result of reset is not actually worked due to the non-instant flush as you know

Moving the DeletedBlocksTransaction to common hdds.proto is an ideal solution, but it will lead to the compatibility problem, so I adds the import of ScmServerDatanodeHeartbeatProtocol.proto
I don't think we want this dependency chain. hdds.proto exists to prevent the admin and heartbeat proto from depending on each other. Cross client and rolling upgrade compatability (future work) will be harder to maintain with this dependency. The DeletedBlocksTransaction message is not very complicated. Could we make a different version of that message to be used in the client response placed in ScmAdminProtocol.proto?
Moving the DeletedBlocksTransaction to common hdds.proto is an ideal solution, but it will lead to the compatibility problem, so I adds the import of ScmServerDatanodeHeartbeatProtocol.proto
I don't think we want this dependency chain. hdds.proto exists to prevent the admin and heartbeat proto from depending on each other. Cross client and rolling upgrade compatability (future work) will be harder to maintain with this dependency. The DeletedBlocksTransaction message is not very complicated. Could we make a different version of that message to be used in the client response placed in ScmAdminProtocol.proto?
The problem mentioned is right, as the migration of proto would bring the compatibility issue, I just considered the reuse form. I have now added the DeletedBlocksTransactionInfo
Thanks for the proto update @Xushaohong. I probably won't have time to review the rest of this PR but that part looks good. Just a question: I see the new proto is in hdds.proto. Would it make more sense to be in SCMAdminProtocol.proto since it is used as the response to an SCM admin command?
Thanks for the proto update @Xushaohong. I probably won't have time to review the rest of this PR but that part looks good. Just a question: I see the new proto is in hdds.proto. Would it make more sense to be in SCMAdminProtocol.proto since it is used as the response to an SCM admin command?
Hi @errose28, hdds.proto is a common client proto, my motivation for putting the definition here has two reasons:
- The
DeletedBlocksTransactionInfocould be used for the future client request, it is a prospective placement. Refer to the proto ofContainerInfoProtoandPipeline. - I think the placement in ScmServerDatanodeHeartbeatProtocol.proto is a historical problem. Originally it is only considered to be used in HB, not in client queries. Such common proto shall be unified and could help reduce confusion for the user and reader. So I wonder if someday we change the reference of this TXN proto from the ScmServerDatanodeHeartbeatProtocol.proto to the hdds.proto. And we could deprecate the old reference.
Pls feel free to correct me if i am wrong~
I think the placement in ScmServerDatanodeHeartbeatProtocol.proto is a historical problem. Originally it is only considered to be used in HB, not in client queries. Such common proto shall be unified and could help reduce confusion for the user and reader. So I wonder if someday we change the reference of this TXN proto from the ScmServerDatanodeHeartbeatProtocol.proto to the hdds.proto. And we could deprecate the old reference.
I think this is a good point. If we put the new message in ScmAdminProtocol.proto we will have the two messages forever since we need to support all old clients. If we put the new message in hdds.proto then later we could switch datanode and SCM communication to use the new message in hdds.proto instead of the old one in ScmServerDatanodeHeartbeatProtocol.proto since we do not support rolling upgrades yet.
@errose28 Can this be merged? I see the changes to move to ScmAdminProtocol has been made.
@Xushaohong can you please rebase and resolve conflicts?
@Xushaohong can you please rebase and resolve conflicts?
@kerneltime done
@Xushaohong this looks like a pretty straightforward change, please address the minor nits.
The latest usage is as above
The last patch LGTM + 1. Thanks @Xushaohong for the contribution and @errose28 @swamirishi @kerneltime for the code review.