You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/07/08 06:16:15 UTC

[GitHub] [shardingsphere] soulasuna commented on a diff in pull request #18951: Remove worker-id from compute node instance

soulasuna commented on code in PR #18951:
URL: https://github.com/apache/shardingsphere/pull/18951#discussion_r916495336


##########
shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/workerid/generator/ClusterWorkerIdGenerator.java:
##########
@@ -58,7 +58,7 @@ private long reGenerate() {
             reTryCount++;
             result = generateSequentialId();
             if (result > MAX_WORKER_ID) {
-                result = result % 1024L;
+                result = result % MAX_WORKER_ID + 1;

Review Comment:
   Because worker-id starts from 0



-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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