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


The following commit(s) were added to refs/heads/unstable by this push:
     new 4a8619de chore: remove redundant code in the method `Execute` of 
`slaveof` cmd (#2801)
4a8619de is described below

commit 4a8619de4f89ff7b0e8eb817b66da432decb0dda
Author: fukua95 <[email protected]>
AuthorDate: Sun Feb 23 16:24:05 2025 +0800

    chore: remove redundant code in the method `Execute` of `slaveof` cmd 
(#2801)
---
 src/commands/cmd_server.cc | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/src/commands/cmd_server.cc b/src/commands/cmd_server.cc
index 49197f58..3df1430a 100644
--- a/src/commands/cmd_server.cc
+++ b/src/commands/cmd_server.cc
@@ -962,10 +962,6 @@ class CommandSlaveOf : public Commander {
 
       *output = redis::RESP_OK;
       LOG(WARNING) << "MASTER MODE enabled (user request from '" << 
conn->GetAddr() << "')";
-      if (srv->GetConfig()->cluster_enabled) {
-        srv->slot_migrator->SetStopMigrationFlag(false);
-        LOG(INFO) << "Change server role to master, restart migration task";
-      }
 
       return Status::OK();
     }
@@ -977,10 +973,6 @@ class CommandSlaveOf : public Commander {
       *output = redis::RESP_OK;
       LOG(WARNING) << "SLAVE OF " << host_ << ":" << port_ << " enabled (user 
request from '" << conn->GetAddr()
                    << "')";
-      if (srv->GetConfig()->cluster_enabled) {
-        srv->slot_migrator->SetStopMigrationFlag(true);
-        LOG(INFO) << "Change server role to slave, stop migration task";
-      }
     } else {
       LOG(ERROR) << "SLAVE OF " << host_ << ":" << port_ << " (user request 
from '" << conn->GetAddr()
                  << "') encounter error: " << s.Msg();

Reply via email to