-
Notifications
You must be signed in to change notification settings - Fork 377
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
replication: do not ignore replication_connect_quorum
On bootstrap and after initial configuration replication_connect_quorum was ignored. The instance tried to connect to every replica listed in replication parameter, and failed if it wasn't possible. The patch alters this behaviour. An instance still tries to connect to every node listed in box.cfg.replication, but does not raise an error if it was able to connect to at least replication_connect_quorum instances. Closes #3428 @TarantoolBot document Title: replication_connect_quorum is not ignored Now on replica set bootstrap and in case of replication reconfiguration (e.g. calling box.cfg{replication=...} for the second time) tarantool doesn't fail, if it couldn't connect to to every replica, but could connect to replication_connect_quorum replicas. If after replication_connect_timeout seconds the instance is not connected to at least replication_connect_quorum other instances, we throw an error.
- Loading branch information
1 parent
438a4e6
commit c1a16b2
Showing
6 changed files
with
128 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env tarantool | ||
|
||
local SOCKET_DIR = require('fio').cwd() | ||
|
||
local QUORUM = tonumber(arg[1]) | ||
local TIMEOUT = arg[2] and tonumber(arg[2]) or 0.1 | ||
local CON_TIMEOUT = arg[3] and tonumber(arg[3]) or 30.0 | ||
INSTANCE_URI = SOCKET_DIR .. '/replica_quorum.sock' | ||
|
||
function nonexistent_uri(id) | ||
return SOCKET_DIR .. '/replica_quorum' .. (1000 + id) .. '.sock' | ||
end | ||
|
||
require('console').listen(os.getenv('ADMIN')) | ||
|
||
box.cfg{ | ||
listen = INSTANCE_URI, | ||
replication_timeout = TIMEOUT, | ||
replication_connect_timeout = CON_TIMEOUT, | ||
replication_connect_quorum = QUORUM, | ||
replication = {INSTANCE_URI, | ||
nonexistent_uri(1), | ||
nonexistent_uri(2)} | ||
} |