[kafka] branch trunk updated: KAFKA-15022: [3/N] use graph to compute rack aware assignment for active stateful tasks (#14030)

2023-07-26 Thread mjsax
This is an automated email from the ASF dual-hosted git repository.

mjsax pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
 new ed44bcd71b3 KAFKA-15022: [3/N] use graph to compute rack aware 
assignment for active stateful tasks (#14030)
ed44bcd71b3 is described below

commit ed44bcd71b3b9926c474033882eaa6c1cf35cfa4
Author: Hao Li <1127478+lihao...@users.noreply.github.com>
AuthorDate: Wed Jul 26 16:02:52 2023 -0700

KAFKA-15022: [3/N] use graph to compute rack aware assignment for active 
stateful tasks (#14030)

Part of KIP-925.

Reviewers: Matthias J. Sax 
---
 checkstyle/suppressions.xml|   2 +-
 .../processor/internals/assignment/Graph.java  |  41 +-
 .../assignment/RackAwareTaskAssignor.java  | 232 +++-
 .../internals/assignment/AssignmentTestUtils.java  |  40 +-
 .../processor/internals/assignment/GraphTest.java  |  57 +-
 .../assignment/RackAwareTaskAssignorTest.java  | 653 +++--
 6 files changed, 902 insertions(+), 123 deletions(-)

diff --git a/checkstyle/suppressions.xml b/checkstyle/suppressions.xml
index 547a8e4b24a..0c40bcf446b 100644
--- a/checkstyle/suppressions.xml
+++ b/checkstyle/suppressions.xml
@@ -201,7 +201,7 @@
   files="Murmur3.java"/>
 
 
+  
files="(KStreamSlidingWindowAggregate|RackAwareTaskAssignor).java"/>
 
 
 > {
 this(destination, capacity, cost, residualFlow, flow, true);
 }
 
-public Edge(final V destination, final int capacity, final int cost, 
final int residualFlow, final int flow,
-final boolean forwardEdge) {
+public Edge(final V destination,
+final int capacity,
+final int cost,
+final int residualFlow,
+final int flow,
+final boolean forwardEdge) {
 Objects.requireNonNull(destination);
 if (capacity < 0) {
 throw new IllegalArgumentException("Edge capacity cannot be 
negative");
@@ -72,8 +76,11 @@ public class Graph> {
 
 final Graph.Edge otherEdge = (Graph.Edge) other;
 
-return destination.equals(otherEdge.destination) && capacity == 
otherEdge.capacity
-&& cost == otherEdge.cost && residualFlow == 
otherEdge.residualFlow && flow == otherEdge.flow
+return destination.equals(otherEdge.destination)
+&& capacity == otherEdge.capacity
+&& cost == otherEdge.cost
+&& residualFlow == otherEdge.residualFlow
+&& flow == otherEdge.flow
 && forwardEdge == otherEdge.forwardEdge;
 }
 
@@ -84,8 +91,15 @@ public class Graph> {
 
 @Override
 public String toString() {
-return "{destination= " + destination + ", capacity=" + capacity + 
", cost=" + cost
-+ ", residualFlow=" + residualFlow + ", flow=" + flow + ", 
forwardEdge=" + forwardEdge;
+return "Edge {"
++ "destination= " + destination
++ ", capacity=" + capacity
++ ", cost=" + cost
++ ", residualFlow=" + residualFlow
++ ", flow=" + flow
++ ", forwardEdge=" + forwardEdge
++ "}";
+
 }
 }
 
@@ -106,12 +120,13 @@ public class Graph> {
 addEdge(u, new Edge(v, capacity, cost, capacity - flow, flow));
 }
 
-public Set nodes() {
+public SortedSet nodes() {
 return nodes;
 }
 
-public Map edges(final V node) {
-return adjList.get(node);
+public SortedMap edges(final V node) {
+final SortedMap edge = adjList.get(node);
+return edge == null ? new TreeMap<>() : edge;
 }
 
 public boolean isResidualGraph() {
@@ -126,12 +141,12 @@ public class Graph> {
 sinkNode = node;
 }
 
-public int totalCost() {
-int totalCost = 0;
+public long totalCost() {
+long totalCost = 0;
 for (final Map.Entry> nodeEdges : 
adjList.entrySet()) {
 final SortedMap edges = nodeEdges.getValue();
-for (final Entry nodeEdge : edges.entrySet()) {
-totalCost += nodeEdge.getValue().cost * 
nodeEdge.getValue().flow;
+for (final Edge nodeEdge : edges.values()) {
+totalCost += (long) nodeEdge.cost * nodeEdge.flow;
 }
 }
 return totalCost;
diff --git 
a/streams/src/main/java/org/apache/kafka/streams/processor/internals/assignment/RackAwareTaskAssignor.java
 
b/streams/src/main/java/org/apache/kafka/streams/processor/internals/assignment/RackAwareTaskAssignor.java
index 0452620f972..0b52cad482d 100644
--- 
a/streams/src/main/java/org/apache/kafka/streams/processor/internals/assignment/RackAwareTaskAssignor.java
+++ 

[kafka] branch 3.5 updated: KAFKA-15235: Fix broken coverage reports since migration to Gradle 8.x (#14075)

2023-07-26 Thread divijv
This is an automated email from the ASF dual-hosted git repository.

divijv pushed a commit to branch 3.5
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/3.5 by this push:
 new eada8846cc1 KAFKA-15235: Fix broken coverage reports since migration 
to Gradle 8.x (#14075)
eada8846cc1 is described below

commit eada8846cc13a35b3b95b1b8bf2485ded50aec6e
Author: Said Boudjelda 
AuthorDate: Wed Jul 26 19:52:02 2023 +0200

KAFKA-15235: Fix broken coverage reports since migration to Gradle 8.x 
(#14075)

Reviewers: Divij Vaidya 
---
 build.gradle | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/build.gradle b/build.gradle
index 34243388234..15019c112fd 100644
--- a/build.gradle
+++ b/build.gradle
@@ -33,6 +33,7 @@ buildscript {
 plugins {
   id 'com.github.ben-manes.versions' version '0.46.0'
   id 'idea'
+  id 'jacoco'
   id 'java-library'
   id 'org.owasp.dependencycheck' version '8.1.2'
   id 'org.nosphere.apache.rat' version "0.8.0"
@@ -729,9 +730,9 @@ subprojects {
 dependsOn tasks.test
 sourceSets sourceSets.main
 reports {
-  html.enabled = true
-  xml.enabled = true
-  csv.enabled = false
+  html.required = true
+  xml.required = true
+  csv.required = false
 }
   }
 
@@ -802,10 +803,9 @@ if (userEnableTestCoverage) {
 executionData.from = javaProjects.jacocoTestReport.executionData
 
 reports {
-  html.enabled = true
-  xml.enabled = true
+  html.required = true
+  xml.required = true
 }
-
 // workaround to ignore projects that don't have any tests at all
 onlyIf = { true }
 doFirst {



[kafka] branch trunk updated: KAFKA-15235: Fix broken coverage reports since migration to Gradle 8.x (#14075)

2023-07-26 Thread divijv
This is an automated email from the ASF dual-hosted git repository.

divijv pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
 new 8135b6dfd85 KAFKA-15235: Fix broken coverage reports since migration 
to Gradle 8.x (#14075)
8135b6dfd85 is described below

commit 8135b6dfd85b7e6e08bf21a6217dc981433b8c2b
Author: Said Boudjelda 
AuthorDate: Wed Jul 26 19:52:02 2023 +0200

KAFKA-15235: Fix broken coverage reports since migration to Gradle 8.x 
(#14075)

Reviewers: Divij Vaidya 
---
 build.gradle | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/build.gradle b/build.gradle
index 40d7a93a57a..11e16368435 100644
--- a/build.gradle
+++ b/build.gradle
@@ -33,6 +33,7 @@ buildscript {
 plugins {
   id 'com.github.ben-manes.versions' version '0.47.0'
   id 'idea'
+  id 'jacoco'
   id 'java-library'
   id 'org.owasp.dependencycheck' version '8.2.1'
   id 'org.nosphere.apache.rat' version "0.8.0"
@@ -735,9 +736,9 @@ subprojects {
 dependsOn tasks.test
 sourceSets sourceSets.main
 reports {
-  html.enabled = true
-  xml.enabled = true
-  csv.enabled = false
+  html.required = true
+  xml.required = true
+  csv.required = false
 }
   }
 
@@ -808,10 +809,9 @@ if (userEnableTestCoverage) {
 executionData.from = javaProjects.jacocoTestReport.executionData
 
 reports {
-  html.enabled = true
-  xml.enabled = true
+  html.required = true
+  xml.required = true
 }
-
 // workaround to ignore projects that don't have any tests at all
 onlyIf = { true }
 doFirst {



[kafka] branch trunk updated: MINOR: upgrade version of gradle plugin (ben-manes.versions) to 0.47.0 (#14098)

2023-07-26 Thread divijv
This is an automated email from the ASF dual-hosted git repository.

divijv pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
 new e5fb9b61fb6 MINOR: upgrade version of gradle plugin 
(ben-manes.versions) to 0.47.0 (#14098)
e5fb9b61fb6 is described below

commit e5fb9b61fb682ffa3d024a68bfb86bd793a08f6e
Author: Said Boudjelda 
AuthorDate: Wed Jul 26 19:12:27 2023 +0200

MINOR: upgrade version of gradle plugin (ben-manes.versions) to 0.47.0 
(#14098)

Reviewers: Divij Vaidya 
---
 build.gradle | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/build.gradle b/build.gradle
index e4270615571..40d7a93a57a 100644
--- a/build.gradle
+++ b/build.gradle
@@ -31,7 +31,7 @@ buildscript {
 }
 
 plugins {
-  id 'com.github.ben-manes.versions' version '0.46.0'
+  id 'com.github.ben-manes.versions' version '0.47.0'
   id 'idea'
   id 'java-library'
   id 'org.owasp.dependencycheck' version '8.2.1'



[kafka] branch trunk updated: KAFKA-15196 Additional ZK migration metrics (#14028)

2023-07-26 Thread davidarthur
This is an automated email from the ASF dual-hosted git repository.

davidarthur pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
 new a900794ace4 KAFKA-15196 Additional ZK migration metrics (#14028)
a900794ace4 is described below

commit a900794ace4dcf1f9dadee27fbd8b63979532a18
Author: David Arthur 
AuthorDate: Wed Jul 26 12:54:59 2023 -0400

KAFKA-15196 Additional ZK migration metrics (#14028)

This patch adds several metrics defined in KIP-866:

* MigratingZkBrokerCount: the number of zk brokers registered with KRaft
* ZkWriteDeltaTimeMs: time spent writing MetadataDelta to ZK
* ZkWriteSnapshotTimeMs: time spent writing MetadataImage to ZK
* Adds value 4 for "ZK" to ZkMigrationState

Also fixes a typo in the metric name introduced in #14009 (ZKWriteBehindLag 
-> ZkWriteBehindLag)

Reviewers: Luke Chen , Colin P. McCabe 

---
 .../scala/kafka/controller/KafkaController.scala   |  6 +++-
 .../apache/kafka/controller/QuorumController.java  |  2 ++
 .../metrics/ControllerMetadataMetrics.java | 26 +-
 .../ControllerMetadataMetricsPublisher.java|  6 
 .../metrics/ControllerMetricsChanges.java  | 13 +++
 .../metrics/QuorumControllerMetrics.java   | 31 +---
 .../metadata/migration/KRaftMigrationDriver.java   | 18 +++---
 .../metadata/migration/KRaftMigrationZkWriter.java |  9 -
 .../kafka/metadata/migration/ZkMigrationState.java |  9 -
 .../metrics/ControllerMetadataMetricsTest.java |  1 +
 .../metrics/ControllerMetricsChangesTest.java  | 42 ++
 .../metrics/QuorumControllerMetricsTest.java   | 14 
 12 files changed, 152 insertions(+), 25 deletions(-)

diff --git a/core/src/main/scala/kafka/controller/KafkaController.scala 
b/core/src/main/scala/kafka/controller/KafkaController.scala
index fa2575d9d8b..baba44f943b 100644
--- a/core/src/main/scala/kafka/controller/KafkaController.scala
+++ b/core/src/main/scala/kafka/controller/KafkaController.scala
@@ -22,7 +22,7 @@ import java.util.concurrent.TimeUnit
 import kafka.api._
 import kafka.common._
 import kafka.cluster.Broker
-import kafka.controller.KafkaController.{ActiveBrokerCountMetricName, 
ActiveControllerCountMetricName, AlterReassignmentsCallback, 
ControllerStateMetricName, ElectLeadersCallback, FencedBrokerCountMetricName, 
GlobalPartitionCountMetricName, GlobalTopicCountMetricName, 
ListReassignmentsCallback, OfflinePartitionsCountMetricName, 
PreferredReplicaImbalanceCountMetricName, 
ReplicasIneligibleToDeleteCountMetricName, ReplicasToDeleteCountMetricName, 
TopicsIneligibleToDeleteCountMetricName, Top [...]
+import kafka.controller.KafkaController.{ActiveBrokerCountMetricName, 
ActiveControllerCountMetricName, AlterReassignmentsCallback, 
ControllerStateMetricName, ElectLeadersCallback, FencedBrokerCountMetricName, 
GlobalPartitionCountMetricName, GlobalTopicCountMetricName, 
ListReassignmentsCallback, OfflinePartitionsCountMetricName, 
PreferredReplicaImbalanceCountMetricName, 
ReplicasIneligibleToDeleteCountMetricName, ReplicasToDeleteCountMetricName, 
TopicsIneligibleToDeleteCountMetricName, Top [...]
 import kafka.coordinator.transaction.ZkProducerIdManager
 import kafka.server._
 import kafka.server.metadata.ZkFinalizedFeatureCache
@@ -44,6 +44,7 @@ import org.apache.kafka.common.protocol.Errors
 import org.apache.kafka.common.requests.{AbstractControlRequest, ApiError, 
LeaderAndIsrResponse, UpdateFeaturesRequest, UpdateMetadataResponse}
 import org.apache.kafka.common.utils.{Time, Utils}
 import org.apache.kafka.metadata.LeaderRecoveryState
+import org.apache.kafka.metadata.migration.ZkMigrationState
 import org.apache.kafka.server.common.{AdminOperationException, 
ProducerIdsBlock}
 import org.apache.kafka.server.metrics.KafkaMetricsGroup
 import org.apache.kafka.server.util.KafkaScheduler
@@ -81,9 +82,11 @@ object KafkaController extends Logging {
   private val ReplicasIneligibleToDeleteCountMetricName = 
"ReplicasIneligibleToDeleteCount"
   private val ActiveBrokerCountMetricName = "ActiveBrokerCount"
   private val FencedBrokerCountMetricName = "FencedBrokerCount"
+  private val ZkMigrationStateMetricName = "ZkMigrationState"
 
   // package private for testing
   private[controller] val MetricNames = Set(
+ZkMigrationStateMetricName,
 ActiveControllerCountMetricName,
 OfflinePartitionsCountMetricName,
 PreferredReplicaImbalanceCountMetricName,
@@ -172,6 +175,7 @@ class KafkaController(val config: KafkaConfig,
   /* single-thread scheduler to clean expired tokens */
   private val tokenCleanScheduler = new KafkaScheduler(1, true, 
"delegation-token-cleaner")
 
+  metricsGroup.newGauge(ZkMigrationStateMetricName, () => ZkMigrationState.ZK)
   metricsGroup.newGauge(ActiveControllerCountMetricName, () => if (isActive) 1 
else 0)
   

[kafka] branch trunk updated: KAFKA-15243: Set decoded user names to DescribeUserScramCredentialsResponse (#14094)

2023-07-26 Thread manikumar
This is an automated email from the ASF dual-hosted git repository.

manikumar pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
 new 6d81698ba4c KAFKA-15243: Set decoded user names to 
DescribeUserScramCredentialsResponse (#14094)
6d81698ba4c is described below

commit 6d81698ba4cb9c62185b0a50cc81ddea3047994d
Author: sciclon2 <74413315+scicl...@users.noreply.github.com>
AuthorDate: Wed Jul 26 15:48:09 2023 +0200

KAFKA-15243: Set decoded user names to DescribeUserScramCredentialsResponse 
(#14094)


Reviewers: Manikumar Reddy 
---
 .../main/scala/kafka/server/ZkAdminManager.scala   |  2 +-
 .../AlterUserScramCredentialsRequestTest.scala | 50 ++
 2 files changed, 32 insertions(+), 20 deletions(-)

diff --git a/core/src/main/scala/kafka/server/ZkAdminManager.scala 
b/core/src/main/scala/kafka/server/ZkAdminManager.scala
index 31ab40430d7..00ef867de9c 100644
--- a/core/src/main/scala/kafka/server/ZkAdminManager.scala
+++ b/core/src/main/scala/kafka/server/ZkAdminManager.scala
@@ -848,7 +848,7 @@ class ZkAdminManager(val config: KafkaConfig,
 try {
   if (describingAllUsers)
 adminZkClient.fetchAllEntityConfigs(ConfigType.User).foreach {
-  case (user, properties) => addToResultsIfHasScramCredential(user, 
properties) }
+  case (user, properties) => 
addToResultsIfHasScramCredential(Sanitizer.desanitize(user), properties) }
   else {
 // describing specific users
 val illegalUsers = users.get.filter(_.isEmpty).toSet
diff --git 
a/core/src/test/scala/unit/kafka/server/AlterUserScramCredentialsRequestTest.scala
 
b/core/src/test/scala/unit/kafka/server/AlterUserScramCredentialsRequestTest.scala
index 2503522eea2..159524c92d1 100644
--- 
a/core/src/test/scala/unit/kafka/server/AlterUserScramCredentialsRequestTest.scala
+++ 
b/core/src/test/scala/unit/kafka/server/AlterUserScramCredentialsRequestTest.scala
@@ -72,6 +72,7 @@ class AlterUserScramCredentialsRequestTest extends 
BaseRequestTest {
   private val saltBytes = "salt".getBytes(StandardCharsets.UTF_8)
   private val user1 = "user1"
   private val user2 = "user2"
+  private val user3 = "us...@user3.com"
   private val unknownUser = "unknownUser"
 
   @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumName)
@@ -163,21 +164,21 @@ class AlterUserScramCredentialsRequestTest extends 
BaseRequestTest {
 val deletionUnknown1 = new 
AlterUserScramCredentialsRequestData.ScramCredentialDeletion().setName(user1).setMechanism(ScramMechanism.UNKNOWN.`type`)
 val deletionValid1 = new 
AlterUserScramCredentialsRequestData.ScramCredentialDeletion().setName(user1).setMechanism(ScramMechanism.SCRAM_SHA_256.`type`)
 val deletionUnknown2 = new 
AlterUserScramCredentialsRequestData.ScramCredentialDeletion().setName(user2).setMechanism(10.toByte)
-val user3 = "user3"
-val upsertionUnknown3 = new 
AlterUserScramCredentialsRequestData.ScramCredentialUpsertion().setName(user3).setMechanism(ScramMechanism.UNKNOWN.`type`)
-  
.setIterations(8192).setSalt(saltBytes).setSaltedPassword(saltedPasswordBytes)
-val upsertionValid3 = new 
AlterUserScramCredentialsRequestData.ScramCredentialUpsertion().setName(user3).setMechanism(ScramMechanism.SCRAM_SHA_256.`type`)
-  
.setIterations(8192).setSalt(saltBytes).setSaltedPassword(saltedPasswordBytes)
 val user4 = "user4"
-val upsertionUnknown4 = new 
AlterUserScramCredentialsRequestData.ScramCredentialUpsertion().setName(user4).setMechanism(10.toByte)
+val upsertionUnknown4 = new 
AlterUserScramCredentialsRequestData.ScramCredentialUpsertion().setName(user4).setMechanism(ScramMechanism.UNKNOWN.`type`)
+  
.setIterations(8192).setSalt(saltBytes).setSaltedPassword(saltedPasswordBytes)
+val upsertionValid4 = new 
AlterUserScramCredentialsRequestData.ScramCredentialUpsertion().setName(user4).setMechanism(ScramMechanism.SCRAM_SHA_256.`type`)
   
.setIterations(8192).setSalt(saltBytes).setSaltedPassword(saltedPasswordBytes)
 val user5 = "user5"
-val upsertionUnknown5 = new 
AlterUserScramCredentialsRequestData.ScramCredentialUpsertion().setName(user5).setMechanism(ScramMechanism.UNKNOWN.`type`)
+val upsertionUnknown5 = new 
AlterUserScramCredentialsRequestData.ScramCredentialUpsertion().setName(user5).setMechanism(10.toByte)
+  
.setIterations(8192).setSalt(saltBytes).setSaltedPassword(saltedPasswordBytes)
+val user6 = "user6"
+val upsertionUnknown6 = new 
AlterUserScramCredentialsRequestData.ScramCredentialUpsertion().setName(user6).setMechanism(ScramMechanism.UNKNOWN.`type`)
   
.setIterations(8192).setSalt(saltBytes).setSaltedPassword(saltedPasswordBytes)
 val request = new AlterUserScramCredentialsRequest.Builder(
 new AlterUserScramCredentialsRequestData()
   .setDeletions(util.Arrays.asList(deletionUnknown1, 

[kafka] branch trunk updated: [MINOR] Fix Javadoc comment in KafkaFuture#toCompletionStage (#14100)

2023-07-26 Thread showuon
This is an automated email from the ASF dual-hosted git repository.

showuon pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
 new ff390ab60a5 [MINOR] Fix Javadoc comment in 
KafkaFuture#toCompletionStage (#14100)
ff390ab60a5 is described below

commit ff390ab60a57100cc829be243ce525ac31523000
Author: vamossagar12 
AuthorDate: Wed Jul 26 17:56:20 2023 +0530

[MINOR] Fix Javadoc comment in KafkaFuture#toCompletionStage (#14100)

Fix Javadoc comment in KafkaFuture#toCompletionStage

Reviewers: Luke Chen 
---
 clients/src/main/java/org/apache/kafka/common/KafkaFuture.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clients/src/main/java/org/apache/kafka/common/KafkaFuture.java 
b/clients/src/main/java/org/apache/kafka/common/KafkaFuture.java
index 92296fef71e..74448a93978 100644
--- a/clients/src/main/java/org/apache/kafka/common/KafkaFuture.java
+++ b/clients/src/main/java/org/apache/kafka/common/KafkaFuture.java
@@ -110,7 +110,7 @@ public abstract class KafkaFuture implements Future {
  * {@code CompletionStage} will work normally.
  *
  * If you want to block on the completion of a KafkaFuture you should 
use
- * {@link #get()}, {@link #get(long, TimeUnit)} or {@link 
#getNow(Object)}, rather then calling
+ * {@link #get()}, {@link #get(long, TimeUnit)} or {@link 
#getNow(Object)}, rather than calling
  * {@code .toCompletionStage().toCompletableFuture().get()} etc.
  *
  * @since Kafka 3.0



[kafka] branch trunk updated: KAFKA-14583: Move ReplicaVerificationTool to tools (#14059)

2023-07-26 Thread mimaison
This is an automated email from the ASF dual-hosted git repository.

mimaison pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
 new bb677c4959e KAFKA-14583: Move ReplicaVerificationTool to tools (#14059)
bb677c4959e is described below

commit bb677c4959e18efbb3dae0b4bde123fca7c9ba33
Author: Federico Valeri 
AuthorDate: Wed Jul 26 12:04:34 2023 +0200

KAFKA-14583: Move ReplicaVerificationTool to tools (#14059)


Reviewers: Mickael Maison 
---
 bin/kafka-replica-verification.sh  |   2 +-
 bin/windows/kafka-replica-verification.bat |   2 +-
 checkstyle/suppressions.xml|   2 +-
 .../kafka/tools/ReplicaVerificationTool.scala  | 524 ---
 .../kafka/tools/ReplicaVerificationToolTest.scala  |  65 --
 .../services/replica_verification_tool.py  |  12 +-
 .../kafka/tools/ReplicaVerificationTool.java   | 744 +
 .../kafka/tools/ReplicaVerificationToolTest.java   |  72 ++
 8 files changed, 823 insertions(+), 600 deletions(-)

diff --git a/bin/kafka-replica-verification.sh 
b/bin/kafka-replica-verification.sh
index 4960836c0d0..1df563975a8 100755
--- a/bin/kafka-replica-verification.sh
+++ b/bin/kafka-replica-verification.sh
@@ -14,4 +14,4 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-exec $(dirname $0)/kafka-run-class.sh kafka.tools.ReplicaVerificationTool "$@"
+exec $(dirname $0)/kafka-run-class.sh 
org.apache.kafka.tools.ReplicaVerificationTool "$@"
diff --git a/bin/windows/kafka-replica-verification.bat 
b/bin/windows/kafka-replica-verification.bat
index bf4805d7f64..a64d6f0ad75 100644
--- a/bin/windows/kafka-replica-verification.bat
+++ b/bin/windows/kafka-replica-verification.bat
@@ -14,4 +14,4 @@ rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 
express or implied.
 rem See the License for the specific language governing permissions and
 rem limitations under the License.
 
-"%~dp0kafka-run-class.bat" kafka.tools.ReplicaVerificationTool %*
+"%~dp0kafka-run-class.bat" org.apache.kafka.tools.ReplicaVerificationTool %*
diff --git a/checkstyle/suppressions.xml b/checkstyle/suppressions.xml
index a2b07913356..547a8e4b24a 100644
--- a/checkstyle/suppressions.xml
+++ b/checkstyle/suppressions.xml
@@ -266,7 +266,7 @@
 
 
+  
files="(ProducerPerformance|StreamsResetter|Agent|TransactionalMessageCopier|ReplicaVerificationTool).java"/>
 
 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 kafka.tools
-
-import joptsimple.OptionParser
-import kafka.utils._
-import org.apache.kafka.clients._
-import org.apache.kafka.clients.admin.{Admin, ListTopicsOptions, 
TopicDescription}
-import org.apache.kafka.clients.consumer.{ConsumerConfig, KafkaConsumer}
-import org.apache.kafka.common.message.FetchResponseData
-import org.apache.kafka.common.metrics.Metrics
-import org.apache.kafka.common.network.{NetworkReceive, Selectable, Selector}
-import org.apache.kafka.common.protocol.{ApiKeys, Errors}
-import org.apache.kafka.common.requests.AbstractRequest.Builder
-import org.apache.kafka.common.requests.{AbstractRequest, FetchRequest, 
FetchResponse, ListOffsetsRequest}
-import org.apache.kafka.common.serialization.StringDeserializer
-import org.apache.kafka.server.util.{CommandLineUtils, ShutdownableThread}
-import org.apache.kafka.common.utils.{LogContext, Time}
-import org.apache.kafka.common.{Node, TopicPartition, Uuid}
-
-import java.net.SocketTimeoutException
-import java.text.SimpleDateFormat
-import java.util
-import java.util.concurrent.CountDownLatch
-import java.util.concurrent.atomic.{AtomicInteger, AtomicReference}
-import java.util.regex.{Pattern, PatternSyntaxException}
-import java.util.{Date, Optional, Properties}
-import scala.collection.Seq
-import scala.jdk.CollectionConverters._
-import org.apache.kafka.server.util.TopicFilter.IncludeList
-
-/**
- * For verifying the consistency among replicas.
- *
- *  1. start a fetcher on every broker.
- *  2. each fetcher does the following
- *2.1 issues fetch request
- *2.2 puts the fetched result in a shared buffer
- *2.3 waits for all other fetchers to finish step 2.2
- *2.4 one of the fetchers verifies the consistency of fetched results 
among replicas
- *
- * The consistency verification is up to the high watermark. The tool reports 
the
- * max lag between the verified offset and the high watermark among all 
partitions.
- *
- * If a broker goes down, the verification of the partitions on that broker is 

[kafka] branch trunk updated: MINOR: Upgrade the minor version of snappy dependency to 1.1.10.3 (#14072)

2023-07-26 Thread divijv
This is an automated email from the ASF dual-hosted git repository.

divijv pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
 new 4d30cbf3cd0 MINOR: Upgrade the minor version of snappy dependency to 
1.1.10.3 (#14072)
4d30cbf3cd0 is described below

commit 4d30cbf3cd0644e21630e87a1de919759b8c231b
Author: Said Boudjelda 
AuthorDate: Wed Jul 26 11:21:36 2023 +0200

MINOR: Upgrade the minor version of snappy dependency to 1.1.10.3 (#14072)

Reviewers: Divij Vaidya 
---
 LICENSE-binary | 2 +-
 gradle/dependencies.gradle | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/LICENSE-binary b/LICENSE-binary
index 0ad69cefcef..cc0d9a34272 100644
--- a/LICENSE-binary
+++ b/LICENSE-binary
@@ -259,7 +259,7 @@ scala-library-2.13.11
 scala-logging_2.13-3.9.4
 scala-reflect-2.13.11
 scala-java8-compat_2.13-1.0.2
-snappy-java-1.1.10.1
+snappy-java-1.1.10.3
 swagger-annotations-2.2.8
 zookeeper-3.6.4
 zookeeper-jute-3.6.4
diff --git a/gradle/dependencies.gradle b/gradle/dependencies.gradle
index 0a6c2d69fbb..07f18f4c02e 100644
--- a/gradle/dependencies.gradle
+++ b/gradle/dependencies.gradle
@@ -142,7 +142,7 @@ versions += [
   scalaJava8Compat : "1.0.2",
   scoverage: "1.9.3",
   slf4j: "1.7.36",
-  snappy: "1.1.10.1",
+  snappy: "1.1.10.3",
   spotbugs: "4.7.3",
   // New version of Swagger 2.2.14 requires minimum JDK 11.
   swaggerAnnotations: "2.2.8",



[kafka] branch trunk updated: MINOR: Add co-authors to release email template (#14080)

2023-07-26 Thread divijv
This is an automated email from the ASF dual-hosted git repository.

divijv pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
 new 206a4af0d1e MINOR: Add co-authors to release email template (#14080)
206a4af0d1e is described below

commit 206a4af0d1ecb693ee3cb15c04ca1a83f6e3bf9f
Author: Divij Vaidya 
AuthorDate: Wed Jul 26 11:19:56 2023 +0200

MINOR: Add co-authors to release email template (#14080)

Reviewers: Mickael Maison 
---
 release.py | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/release.py b/release.py
index 7c13d211db0..62ab2df4d2b 100755
--- a/release.py
+++ b/release.py
@@ -332,8 +332,8 @@ def command_release_announcement_email():
 validate_release_num(previous_release_version_num)
 if release_version_num < previous_release_version_num :
 fail("Current release version number can't be less than previous 
release version number")
-number_of_contributors = int(subprocess.check_output('git shortlog -sn 
--no-merges %s..%s | wc -l' % (previous_release_version_num, 
release_version_num) , shell=True).decode('utf-8'))
-contributors = subprocess.check_output("git shortlog -sn --no-merges 
%s..%s | cut -f2 | sort --ignore-case" % (previous_release_version_num, 
release_version_num), shell=True).decode('utf-8')
+number_of_contributors = int(subprocess.check_output('git shortlog -sn 
--group=author --group=trailer:co-authored-by --no-merges %s..%s | uniq | wc 
-l' % (previous_release_version_num, release_version_num) , 
shell=True).decode('utf-8'))
+contributors = subprocess.check_output("git shortlog -sn --group=author 
--group=trailer:co-authored-by --no-merges %s..%s | cut -f2 | sort 
--ignore-case | uniq" % (previous_release_version_num, release_version_num), 
shell=True).decode('utf-8')
 release_announcement_data = {
 'number_of_contributors': number_of_contributors,
 'contributors': ', '.join(str(x) for x in filter(None, 
contributors.split('\n'))),
@@ -391,7 +391,7 @@ Apache Kafka is in use at large and small companies 
worldwide, including
 Capital One, Goldman Sachs, ING, LinkedIn, Netflix, Pinterest, Rabobank,
 Target, The New York Times, Uber, Yelp, and Zalando, among others.
 
-A big thank you for the following %(number_of_contributors)d contributors to 
this release!
+A big thank you for the following %(number_of_contributors)d contributors to 
this release! (Please report an unintended omission)
 
 %(contributors)s
 
@@ -404,7 +404,8 @@ Thank you!
 
 Regards,
 
-""" % release_announcement_data
+
+Release Manager for Apache Kafka %(release_version)s""" % 
release_announcement_data
 
 print()
 print("*")