[GitHub] [kafka] mumrah commented on a diff in pull request #14028: KAFKA-15196 Additional ZK migration metrics

2023-07-24 Thread via GitHub


mumrah commented on code in PR #14028:
URL: https://github.com/apache/kafka/pull/14028#discussion_r1272796566


##
server-common/src/main/java/org/apache/kafka/server/metrics/MetadataTypeMetric.java:
##
@@ -0,0 +1,26 @@
+/*
+ * 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.
+ */
+package org.apache.kafka.server.metrics;
+
+/**
+ * Integer values to represent Kafka metadata types as defined in KIP-866
+ */
+public class MetadataTypeMetric {

Review Comment:
   That's actually an interesting point. ZkMigrationState provides this state 
(and more) for KRaft clusters. One thing that's missing from ZkMigrationState 
is a state for "this is a ZK cluster". I believe this was discussed during the 
KIP-866 discussion, but never finalized. We could add a value `4` to represent 
a ZK cluster.
   
   This would make sense to be reported by KafkaController, but I'm not sure 
about KafkaServer. I wonder if there's a need for the broker to report it's 
metadata type. WDYT?



##
metadata/src/main/java/org/apache/kafka/controller/metrics/ControllerMetadataMetrics.java:
##
@@ -117,6 +120,15 @@ public Integer value() {
 return (int) zkMigrationState();
 }
 }));
+
+if (zkMigrationEnabled) {

Review Comment:
   Yes, seems fine to remove the condition here



-- 
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



[GitHub] [kafka] mumrah commented on a diff in pull request #14028: KAFKA-15196 Additional ZK migration metrics

2023-07-18 Thread via GitHub


mumrah commented on code in PR #14028:
URL: https://github.com/apache/kafka/pull/14028#discussion_r1266763142


##
metadata/src/main/java/org/apache/kafka/controller/metrics/ControllerMetadataMetrics.java:
##
@@ -117,6 +120,15 @@ public Integer value() {
 return (int) zkMigrationState();
 }
 }));
+
+if (zkMigrationEnabled) {

Review Comment:
   We actually want ZkMigrationState reported in all cases. For de-novo KRaft 
clusters, this will be 0 (never migrated) which will let us distinguish from 
clusters which have a completed a migration (3 for post-migration). We can 
remove this metric in 4.0 once ZK and all the migration code is removed



-- 
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



[GitHub] [kafka] mumrah commented on a diff in pull request #14028: KAFKA-15196 Additional ZK migration metrics

2023-07-18 Thread via GitHub


mumrah commented on code in PR #14028:
URL: https://github.com/apache/kafka/pull/14028#discussion_r1266763142


##
metadata/src/main/java/org/apache/kafka/controller/metrics/ControllerMetadataMetrics.java:
##
@@ -117,6 +120,15 @@ public Integer value() {
 return (int) zkMigrationState();
 }
 }));
+
+if (zkMigrationEnabled) {

Review Comment:
   We actually want this one reported in all cases. For de-novo KRaft clusters, 
this will be 0 (never migrated) which will let us distinguish from clusters 
which have a completed a migration (3 for post-migration). We can remove this 
metric in 4.0 once ZK and all the migration code is removed



-- 
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