You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kvrocks.apache.org by hu...@apache.org on 2024/12/19 15:01:03 UTC

(kvrocks-controller) branch unstable updated: Avoid syncing the cluster information to the node if it's restoring (#236)

This is an automated email from the ASF dual-hosted git repository.

hulk pushed a commit to branch unstable
in repository https://gitbox.apache.org/repos/asf/kvrocks-controller.git


The following commit(s) were added to refs/heads/unstable by this push:
     new 01c319b  Avoid syncing the cluster information to the node if it's restoring (#236)
01c319b is described below

commit 01c319bdca46501be78c185642f07d020734cdb1
Author: hulk <hu...@gmail.com>
AuthorDate: Thu Dec 19 23:00:57 2024 +0800

    Avoid syncing the cluster information to the node if it's restoring (#236)
---
 controller/cluster.go | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/controller/cluster.go b/controller/cluster.go
index 5b8d539..4f44953 100644
--- a/controller/cluster.go
+++ b/controller/cluster.go
@@ -112,7 +112,7 @@ func (c *ClusterChecker) probeNode(ctx context.Context, node store.Node) (int64,
 		// And it's fixed in PR: https://github.com/apache/kvrocks/pull/2362,
 		// but we need to be compatible with the old version here.
 		if strings.Contains(err.Error(), ErrRestoringBackUp.Error()) {
-			return -1, nil
+			return -1, ErrRestoringBackUp
 		} else if strings.Contains(err.Error(), ErrClusterNotInitialized.Error()) {
 			return -1, ErrClusterNotInitialized
 		} else {
@@ -203,6 +203,11 @@ func (c *ClusterChecker) parallelProbeNodes(ctx context.Context, cluster *store.
 					zap.String("addr", n.Addr()),
 				)
 				version, err := c.probeNode(ctx, n)
+				// Don't sync the cluster info to the node if it is restoring the db from backup
+				if errors.Is(err, ErrRestoringBackUp) {
+					log.Error("The node is restoring the db from backup")
+					return
+				}
 				if err != nil && !errors.Is(err, ErrClusterNotInitialized) {
 					failureCount := c.increaseFailureCount(shardIdx, n)
 					log.With(zap.Error(err),