Subscription: adapt pipe completion signal for automatically drop subscription#12647
Subscription: adapt pipe completion signal for automatically drop subscription#12647VGalaxies wants to merge 37 commits intoapache:masterfrom
Conversation
...ation-test/src/test/java/org/apache/iotdb/subscription/it/dual/IoTDBSubscriptionTopicIT.java
Outdated
Show resolved
Hide resolved
...-core/datanode/src/main/java/org/apache/iotdb/db/subscription/broker/SubscriptionBroker.java
Outdated
Show resolved
Hide resolved
| topicNames, | ||
| topicNameToUnsubscribe, | ||
| commitContext.getDataNodeId()); | ||
| unsubscribe(topicNameToUnsubscribe); |
There was a problem hiding this comment.
Note that since the pipe is automatically dropped, the "DropPipeProcedure"s in "DropSubscriptionProcedure" will encounter failure in validation... Need to add some checks or else the procedure will fail.
There was a problem hiding this comment.
In DropPipeProcedureV2, no exception will be occurred even if the pipe does not exist...
There was a problem hiding this comment.
Okay, checked that there are not.... However there will be a warn log in PipeDataNodeRemainingEventAndTimeMetrics#deregister. Can you remove it incidentally?
There was a problem hiding this comment.
Okay, checked that there are not.... However there will be a warn log in PipeDataNodeRemainingEventAndTimeMetrics#deregister. Can you remove it incidentally?
added a boolean return value to dropPipe...
...ons/src/main/java/org/apache/iotdb/commons/subscription/meta/consumer/ConsumerGroupMeta.java
Outdated
Show resolved
Hide resolved
…odeRemainingEventAndTimeMetrics#deregister
|
|
||
| @Override | ||
| protected void rollbackFromOperateOnDataNodes(ConfigNodeProcedureEnv env) throws IOException { | ||
| protected void rollbackFromOperateOnDataNodes(final ConfigNodeProcedureEnv env) |
There was a problem hiding this comment.
There are 3 points for the rollback function:
- Usually when we do rollback, we roll back from the last executed to the first executed.
- We do not rollback DataNode and ConfigNode execution of dropping pipe.
- Whether the drop subscription procedure needs to be rolled back may need to be considered twice.
There was a problem hiding this comment.
Usually when we do rollback, we roll back from the last executed to the first executed.
The DropSubscriptionProcedure has been appropriately modified. The CreateSubscriptionProcedure will be modified in subsequent metadata restructuring.
Whether the drop subscription procedure needs to be rolled back may need to be considered twice.
Before metadata restructuring, considering that the process of changing the topic meta and consumer group meta involves multiple procedures, there could be failures during execution. Therefore, it is currently necessary to consider rolling back part of the procedure to ensure CN metadata consistency.
In the subsequent metadata restructuring, we will consider mapping the drop subscription procedure to a single procedure. At that time we can consider not performing rollback to prevent the occurrence of create subscription after the rollback of drop subscription.
|
|
||
| public class SubscriptionTerminationException extends SubscriptionRuntimeCriticalException { | ||
|
|
||
| public SubscriptionTerminationException(final String message) { |
There was a problem hiding this comment.
Consider whether to use it before merge.
Example:
org.apache.iotdb.SubscriptionSessionExample#dataSubscription3,org.apache.iotdb.SubscriptionSessionExample#dataSubscription4