FrankChen021 commented on code in PR #19311: URL: https://github.com/apache/druid/pull/19311#discussion_r3212551979
########## extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/ShareGroupIndexTask.java: ########## @@ -0,0 +1,183 @@ +/* + * 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.druid.indexing.kafka; + +import com.fasterxml.jackson.annotation.JacksonInject; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.apache.druid.indexer.TaskStatus; +import org.apache.druid.indexing.common.TaskToolbox; +import org.apache.druid.indexing.common.actions.TaskActionClient; +import org.apache.druid.indexing.common.config.TaskConfig; +import org.apache.druid.indexing.common.task.AbstractTask; +import org.apache.druid.indexing.common.task.PendingSegmentAllocatingTask; +import org.apache.druid.indexing.common.task.TaskResource; +import org.apache.druid.indexing.common.task.Tasks; +import org.apache.druid.java.util.common.logger.Logger; +import org.apache.druid.segment.indexing.DataSchema; +import org.apache.druid.server.security.AuthorizationUtils; +import org.apache.druid.server.security.ResourceAction; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicReference; + +/** + * Indexing task that consumes from a Kafka topic with share-group semantics + * (KIP-932). The broker tracks delivery state; the task acknowledges records + * after the segments containing them are published. Phase 1: single-threaded, + * no supervisor, no dedup cache. + */ +public class ShareGroupIndexTask extends AbstractTask implements PendingSegmentAllocatingTask Review Comment: [P2] Share-group tasks inherit priority 0 Because ShareGroupIndexTask extends AbstractTask directly and does not override getPriority(), tasks submitted without an explicit context priority use Tasks.DEFAULT_TASK_PRIORITY (0). Existing Kafka realtime tasks use Tasks.DEFAULT_REALTIME_TASK_PRIORITY (75), and TaskLockbox uses task.getPriority() when acquiring or competing for append locks, so these ingestion tasks can lose lock contention or be ordered differently from equivalent Kafka ingestion. Add the same realtime priority override used by SeekableStreamIndexTask. ########## extensions-core/kafka-indexing-service/pom.xml: ########## @@ -252,6 +257,30 @@ </execution> </executions> </plugin> + <plugin> + <!-- + The bundled in-JVM test broker (kafka_2.13:3.9.x, ZooKeeper-mode) was + compiled against kafka-clients 3.9.x and references Utils.mkSet(Object[]), + which was removed in kafka-clients 4.x. This module pins kafka-clients to + 4.2.0 to enable KIP-932 share-group support, so KafkaConfig static + initialization throws NoSuchMethodError under any JVM. The tests below + depend on TestBroker and must be skipped until the test broker migrates to + kafka_2.13:4.x (KRaft) or Testcontainers. Share-group code paths are + covered by ShareGroupIndexTaskRunnerTest, KafkaShareGroupRecordSupplierTest + (mock-based) and embedded-tests/EmbeddedShareGroupIngestionTest + (Testcontainers). Tracked as a follow-up of apache/druid#19311. + --> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <excludes> + <exclude>**/KafkaIndexTaskTest.java</exclude> Review Comment: [P2] Kafka compatibility tests are skipped globally This Surefire exclusion removes the main KafkaIndexTask, KafkaRecordSupplier, KafkaSamplerSpec, and KafkaSupervisor test classes from every normal test run. Since this PR also upgrades kafka-clients to 4.2.0, those are the regression tests most likely to catch compatibility breaks in existing index_kafka ingestion; the new share-group mock and embedded tests do not cover that existing API surface. Please migrate or narrowly isolate the TestBroker-dependent cases instead of excluding the whole classes. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
