Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
check for active replicas when waiting for commands #8314
I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en
Changelog category (leave one):
Changelog entry (up to few sentences, required except for Non-significant/Documentation categories):
This is more a question than a bugfix. Having a
The problem is when a replica is down for any reason, the command is still sent to the replica (which probably make sense) but after that the leader waits forever for the answer.
This patch (not tested, it's just to explain the issue) checks wether a replica is active or not and do not wait for the command to finish.
Does it makes sense?
For OPTIMIZE, it is 100% ok.
For DROP/DETACH/REPLACE PARTITION or CLEAR COLUMN IN PARTITION it is questionable, because a race condition exists: it's possible that some replicas will become active and after this query there are active replicas that still didn't execute the command. And it will be unclear what semantic the user should expect for