smjn commented on code in PR #18929: URL: https://github.com/apache/kafka/pull/18929#discussion_r2077342550
########## group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupCoordinatorService.java: ########## @@ -1172,6 +1203,37 @@ public CompletableFuture<List<DescribedGroup>> shareGroupDescribe( return FutureUtils.combineFutures(futures, ArrayList::new, List::addAll); } + /** + * See {@link GroupCoordinator#alterShareGroupOffsets(AuthorizableRequestContext, String, AlterShareGroupOffsetsRequestData)}. + */ + @Override + public CompletableFuture<AlterShareGroupOffsetsResponseData> alterShareGroupOffsets(AuthorizableRequestContext context, String groupId, AlterShareGroupOffsetsRequestData request) { + if (!isActive.get() || metadataImage == null) { + return CompletableFuture.completedFuture( + AlterShareGroupOffsetsRequest.getErrorAlterShareGroupResponseData(Errors.COORDINATOR_NOT_AVAILABLE)); + } + + if (groupId == null) { + return CompletableFuture.completedFuture( + AlterShareGroupOffsetsRequest.getErrorAlterShareGroupResponseData(Errors.GROUP_ID_NOT_FOUND)); + } + + return runtime.scheduleWriteOperation( + "share-group-alter", + topicPartitionFor(groupId), + Duration.ofMillis(config.offsetCommitTimeoutMs()), + coordinator -> coordinator.alterShareGroupOffsets(groupId, request) + ).thenCompose(result -> + persisterInitialize(result.getValue(), result.getKey()) Review Comment: This chaining of operations will not always work. It may break if the original schedule call fails due to timeout (usually if a broker goes down). You need to plan according to it and see what should happen if that is the case. -- 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