dengziming commented on code in PR #12084:
URL: https://github.com/apache/kafka/pull/12084#discussion_r886352097
##########
core/src/main/scala/kafka/tools/DumpLogSegments.scala:
##########
@@ -288,6 +294,12 @@ object DumpLogSegments {
case ControlRecordType.ABORT | ControlRecordType.COMMIT =>
val endTxnMarker = EndTransactionMarker.deserialize(record)
print(s" endTxnMarker: ${endTxnMarker.controlType}
coordinatorEpoch: ${endTxnMarker.coordinatorEpoch}")
+ case ControlRecordType.SNAPSHOT_HEADER =>
+ val header =
ControlRecordUtils.deserializedSnapshotHeaderRecord(record)
+ print(s" SnapshotHeader
${SnapshotHeaderRecordJsonConverter.write(header,
SnapshotHeaderRecord.HIGHEST_SUPPORTED_VERSION)}")
+ case ControlRecordType.SNAPSHOT_FOOTER =>
+ val footer =
ControlRecordUtils.deserializedSnapshotFooterRecord(record)
+ print(s" SnapshotFooter
${SnapshotFooterRecordJsonConverter.write(footer,
SnapshotFooterRecord.HIGHEST_SUPPORTED_VERSION)}")
Review Comment:
It's reasonable to use `footer.version()` here, but I don't think it's
unnecessary to check the version, if it is greater than
HIGHEST_SUPPORTED_VERSION, we may already fail when deserializing it here
because we assume it's HIGHEST_SUPPORTED_VERSION:
https://github.com/apache/kafka/blob/4c9eeef5b2dff9a4f0977fbc5ac7eaaf930d0d0e/clients/src/main/java/org/apache/kafka/common/record/ControlRecordUtils.java#L58-L60
--
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]