You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by "Pengzna (via GitHub)" <gi...@apache.org> on 2025/03/12 14:41:54 UTC

[PR] IoTConsensusV2: Retry with power-increasing interval when follower is read-only [iotdb]

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

   as title.


-- 
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] IoTConsensusV2: Retry with power-increasing interval when follower is read-only [iotdb]

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


-- 
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] IoTConsensusV2: Retry with power-increasing interval when follower is read-only [iotdb]

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


##########
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/agent/task/subtask/PipeReportableSubtask.java:
##########
@@ -151,7 +152,12 @@ private void onNonEnrichedEventFailure(final Throwable throwable) {
         throwable.getMessage(),
         throwable);
     try {
-      Thread.sleep(Math.min(1000L * retryCount.get(), 10000));
+      long sleepInterval = Math.min(1000L * retryCount.get(), 10000);
+      // if receiver is read-only, connector will retry will power-increasing interval
+      if (throwable instanceof PipeConsensusRetryWithIncreasingIntervalException) {
+        sleepInterval = Math.min(1000L * retryCount.get() * retryCount.get(), 1000L * 120);

Review Comment:
   1. Max 20s
   2. Avoid negative after overflow?



-- 
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] IoTConsensusV2: Retry with power-increasing interval when follower is read-only [iotdb]

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


##########
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/agent/task/subtask/PipeReportableSubtask.java:
##########
@@ -151,7 +152,12 @@ private void onNonEnrichedEventFailure(final Throwable throwable) {
         throwable.getMessage(),
         throwable);
     try {
-      Thread.sleep(Math.min(1000L * retryCount.get(), 10000));
+      long sleepInterval = Math.min(1000L * retryCount.get(), 10000);
+      // if receiver is read-only, connector will retry will power-increasing interval
+      if (throwable instanceof PipeConsensusRetryWithIncreasingIntervalException) {
+        sleepInterval = Math.min(1000L * retryCount.get() * retryCount.get(), 1000L * 120);

Review Comment:
   good catch! tql



##########
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/agent/task/subtask/PipeReportableSubtask.java:
##########
@@ -151,7 +152,12 @@ private void onNonEnrichedEventFailure(final Throwable throwable) {
         throwable.getMessage(),
         throwable);
     try {
-      Thread.sleep(Math.min(1000L * retryCount.get(), 10000));
+      long sleepInterval = Math.min(1000L * retryCount.get(), 10000);
+      // if receiver is read-only, connector will retry will power-increasing interval

Review Comment:
   ok



-- 
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] IoTConsensusV2: Retry with power-increasing interval when follower is read-only [iotdb]

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


##########
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/agent/task/subtask/PipeReportableSubtask.java:
##########
@@ -151,7 +152,12 @@ private void onNonEnrichedEventFailure(final Throwable throwable) {
         throwable.getMessage(),
         throwable);
     try {
-      Thread.sleep(Math.min(1000L * retryCount.get(), 10000));
+      long sleepInterval = Math.min(1000L * retryCount.get(), 10000);
+      // if receiver is read-only, connector will retry will power-increasing interval
+      if (throwable instanceof PipeConsensusRetryWithIncreasingIntervalException) {
+        sleepInterval = Math.min(1000L * retryCount.get() * retryCount.get(), 1000L * 120);

Review Comment:
   1. Max 20s
   2. Avoid negative after overflow



##########
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/agent/task/subtask/PipeReportableSubtask.java:
##########
@@ -151,7 +152,12 @@ private void onNonEnrichedEventFailure(final Throwable throwable) {
         throwable.getMessage(),
         throwable);
     try {
-      Thread.sleep(Math.min(1000L * retryCount.get(), 10000));
+      long sleepInterval = Math.min(1000L * retryCount.get(), 10000);
+      // if receiver is read-only, connector will retry will power-increasing interval

Review Comment:
   update comments



-- 
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