Caideyipi commented on code in PR #12647: URL: https://github.com/apache/iotdb/pull/12647#discussion_r1628846407
########## iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/subscription/exception/SubscriptionTerminationException.java: ########## @@ -0,0 +1,40 @@ +/* + * 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.iotdb.rpc.subscription.exception; + +import java.util.Objects; + +public class SubscriptionTerminationException extends SubscriptionRuntimeCriticalException { + + public SubscriptionTerminationException(final String message) { Review Comment: Consider whether to use it before merge. ########## iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/impl/subscription/subscription/DropSubscriptionProcedure.java: ########## @@ -242,44 +250,47 @@ protected void rollbackFromOperateOnConfigNodes(ConfigNodeProcedureEnv env) { env.getConfigManager() .getConsensusManager() .write(new AlterMultipleTopicsPlan(alterTopicRollbackPlans)); - } catch (ConsensusException e) { + } catch (final ConsensusException e) { LOGGER.warn("Failed in the write API executing the consensus layer due to: ", e); response = new TSStatus(TSStatusCode.EXECUTE_STATEMENT_ERROR.getStatusCode()); response.setMessage(e.getMessage()); } - // if failed to rollback, throw exception + // If failed to rollback, throw exception if (response.getCode() != TSStatusCode.SUCCESS_STATUS.getStatusCode()) { throw new SubscriptionException(response.getMessage()); } - // Do nothing to rollback dropPipeProcedures + // Rollback AlterConsumerGroupProcedure + alterConsumerGroupProcedure.rollbackFromOperateOnConfigNodes(env); } @Override - protected void rollbackFromOperateOnDataNodes(ConfigNodeProcedureEnv env) throws IOException { + protected void rollbackFromOperateOnDataNodes(final ConfigNodeProcedureEnv env) Review Comment: There are 3 points for the rollback function: 1. Usually when we do rollback, we roll back from the last executed to the first executed. 2. We do not rollback DataNode and ConfigNode execution of dropping pipe. 3. Whether the drop subscription procedure needs to be rolled back may need to be considered twice. -- 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]
