niket-goel commented on a change in pull request #10899:
URL: https://github.com/apache/kafka/pull/10899#discussion_r660133212



##########
File path: 
clients/src/main/java/org/apache/kafka/common/record/ControlRecordUtils.java
##########
@@ -26,19 +28,49 @@
  */
 public class ControlRecordUtils {
 
-    public static final short LEADER_CHANGE_SCHEMA_VERSION = new 
LeaderChangeMessage().highestSupportedVersion();
+    public static final short LEADER_CHANGE_SCHEMA_HIGHEST_VERSION = new 
LeaderChangeMessage().highestSupportedVersion();
+    public static final short SNAPSHOT_HEADER_HIGHEST_VERSION = new 
SnapshotHeaderRecord().highestSupportedVersion();
+    public static final short SNAPSHOT_FOOTER_HIGHEST_VERSION = new 
SnapshotFooterRecord().highestSupportedVersion();
 
     public static LeaderChangeMessage deserializeLeaderChangeMessage(Record 
record) {
         ControlRecordType recordType = ControlRecordType.parse(record.key());
         if (recordType != ControlRecordType.LEADER_CHANGE) {
             throw new IllegalArgumentException(
-                "Expected LEADER_CHANGE control record type(3), but found " + 
recordType.toString());
+                "Expected LEADER_CHANGE control record type(2), but found " + 
recordType.toString());
         }
         return deserializeLeaderChangeMessage(record.value().duplicate());
     }
 
     public static LeaderChangeMessage 
deserializeLeaderChangeMessage(ByteBuffer data) {

Review comment:
       Will cut a JIRA.

##########
File path: clients/src/main/resources/common/message/SnapshotHeaderRecord.json
##########
@@ -0,0 +1,27 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements.  See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License.  You may obtain a copy of the License at
+//
+//    http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+{
+  "type": "data",
+  "name": "SnapshotHeaderRecord",
+  "validVersions": "0",
+  "flexibleVersions": "0+",
+  "fields": [
+    {"name": "Version", "type": "int16", "versions": "0+",
+      "about": "The version of the snapshot header record"},
+    {"name": "LastContainedLogTime", "type": "int64", "versions": "0+",
+      "about": "The append time of the highest record contained in this 
snapshot"}

Review comment:
       That sounds better. Will use this.

##########
File path: 
metadata/src/main/java/org/apache/kafka/controller/QuorumController.java
##########
@@ -345,7 +345,8 @@ void createSnapshotGenerator(long committedOffset, int 
committedEpoch) {
             }
             Optional<SnapshotWriter<ApiMessageAndVersion>> writer = 
raftClient.createSnapshot(
                 committedOffset,
-                committedEpoch
+                committedEpoch,
+                0/*KAFKA-12997*/

Review comment:
       ack.

##########
File path: raft/src/main/java/org/apache/kafka/raft/ReplicatedCounter.java
##########
@@ -106,7 +106,7 @@ public synchronized void handleCommit(BatchReader<Integer> 
reader) {
                     lastCommittedEpoch,
                     lastOffsetSnapshotted
                 );
-                Optional<SnapshotWriter<Integer>> snapshot = 
client.createSnapshot(lastCommittedOffset, lastCommittedEpoch);
+                Optional<SnapshotWriter<Integer>> snapshot = 
client.createSnapshot(lastCommittedOffset, lastCommittedEpoch, 
0/*KAFKA-12997*/);

Review comment:
       ack




-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to