mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-11 18:35:46 +02:00
chore: Forbid replicating a replica (#3779)
* chore: Forbid replicating a replica We do not support connecting a replica to a replica, but before this PR we allowed doing so. This PR disables that behavior. Fixes #3679 * `replicaof_mu_`
This commit is contained in:
parent
9aadc0cd2b
commit
526bce4222
2 changed files with 29 additions and 0 deletions
|
@ -2839,6 +2839,13 @@ void ServerFamily::ReplTakeOver(CmdArgList args, ConnectionContext* cntx) {
|
|||
}
|
||||
|
||||
void ServerFamily::ReplConf(CmdArgList args, ConnectionContext* cntx) {
|
||||
{
|
||||
util::fb2::LockGuard lk(replicaof_mu_);
|
||||
if (!ServerState::tlocal()->is_master) {
|
||||
return cntx->SendError("Replicating a replica is unsupported");
|
||||
}
|
||||
}
|
||||
|
||||
if (args.size() % 2 == 1)
|
||||
goto err;
|
||||
for (unsigned i = 0; i < args.size(); i += 2) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue