You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by "Caideyipi (via GitHub)" <gi...@apache.org> on 2026/08/13 08:40:00 UTC

[PR] [Subscription] Skip runtime when subscription is disabled [iotdb]

Caideyipi opened a new pull request, #18465:
URL: https://github.com/apache/iotdb/pull/18465

   ## Description
   
   When `subscription_enabled=false`, avoid initializing or running DataNode subscription runtime components:
   
   - Skip registration of the Subscription Runtime Agent service.
   - Do not schedule the subscription receiver timeout checker.
   - Return successful no-op responses for subscription progress/runtime RPCs.
   - Keep updating the normal region cache while skipping subscription route callbacks.
   - Avoid accessing the subscription receiver on ordinary client disconnects.
   - Defensively ignore runtime-state updates in `ConsensusSubscriptionSetupHandler`.
   
   This removes the misleading runtime-service startup log, the `SubscriptionReceiverAgent-Timeout-Checker` thread, and subscription runtime-state logs while subscription is disabled.
   
   ## Tests
   
   - `mvn -o -nsu validate -pl iotdb-core/datanode`
   - `mvn -nsu -pl iotdb-core/datanode -am test -Dtest=SubscriptionReceiverAgentTest,ConsensusSubscriptionSetupHandlerTest,DataNodeInternalRPCServiceImplSubscriptionDisabledTest -Dsurefire.failIfNoSpecifiedTests=false -DfailIfNoTests=false`
     - 12 tests passed in a clean worktree.
   
   <hr>
   
   This PR has:
   - [x] been self-reviewed.
   - [x] added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage.
   
   <hr>
   
   ##### Key changed/added classes (or packages if there are too many classes) in this PR
   
   - `DataNode`
   - `ClientRPCServiceImpl`
   - `DataNodeInternalRPCServiceImpl`
   - `SubscriptionReceiverAgent`
   - `ConsensusSubscriptionSetupHandler`


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Subscription] Skip runtime when subscription is disabled [iotdb]

Posted by "jt2594838 (via GitHub)" <gi...@apache.org>.
jt2594838 commented on code in PR #18465:
URL: https://github.com/apache/iotdb/pull/18465#discussion_r3840341032


##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/thrift/impl/DataNodeInternalRPCServiceImpl.java:
##########
@@ -1627,6 +1627,11 @@ public TPushConsumerGroupMetaResp pushSingleConsumerGroupMeta(
 
   @Override
   public TPullCommitProgressResp pullCommitProgress(TPullCommitProgressReq req) {
+    if (!SubscriptionConfig.getInstance().getSubscriptionEnabled()) {
+      return new TPullCommitProgressResp(new TSStatus(TSStatusCode.SUCCESS_STATUS.getStatusCode()))
+          .setCommitRegionProgress(Collections.emptyMap());

Review Comment:
   May use UNSUPPORTED_OPERATION, the same below.



-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Subscription] Skip runtime when subscription is disabled [iotdb]

Posted by "Caideyipi (via GitHub)" <gi...@apache.org>.
Caideyipi commented on code in PR #18465:
URL: https://github.com/apache/iotdb/pull/18465#discussion_r3841121555


##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/thrift/impl/DataNodeInternalRPCServiceImpl.java:
##########
@@ -1627,6 +1627,11 @@ public TPushConsumerGroupMetaResp pushSingleConsumerGroupMeta(
 
   @Override
   public TPullCommitProgressResp pullCommitProgress(TPullCommitProgressReq req) {
+    if (!SubscriptionConfig.getInstance().getSubscriptionEnabled()) {
+      return new TPullCommitProgressResp(new TSStatus(TSStatusCode.SUCCESS_STATUS.getStatusCode()))
+          .setCommitRegionProgress(Collections.emptyMap());

Review Comment:
   Updated in commit 59a0df9a0ea6fe8c1c93e504eb7892012b5e2b32. When subscription is disabled, pullCommitProgress, syncSubscriptionProgress, and pushSubscriptionRuntime now return TSStatusCode.UNSUPPORTED_OPERATION; the pull response still carries an empty progress map. The corresponding test expectations were updated as well.



-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Subscription] Skip runtime when subscription is disabled [iotdb]

Posted by "jt2594838 (via GitHub)" <gi...@apache.org>.
jt2594838 merged PR #18465:
URL: https://github.com/apache/iotdb/pull/18465


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org