mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-27 03:45:11 +00:00
storage_service: Fix Unable to contact any seeds
Sleep before do bootstrap. This code was not converted from Origin. With this we can start multiple nodes simultaneously. ./build/release/seastar -c 1 -m 128M --rpc-address 127.0.0.1 --listen-address 127.0.0.1 --seed-provider-parameters 127.0.0.1 --datadir `pwd`/tmp/1 --commitlog-directory `pwd`/tmp/1 2>&1 | tee /tmp/out1 & ./build/release/seastar -c 1 -m 128M --rpc-address 127.0.0.2 --listen-address 127.0.0.2 --seed-provider-parameters 127.0.0.1 --datadir `pwd`/tmp/2 --commitlog-directory `pwd`/tmp/2 2>&1 | tee /tmp/out2 & ./build/release/seastar -c 1 -m 128M --rpc-address 127.0.0.3 --listen-address 127.0.0.3 --seed-provider-parameters 127.0.0.1 --datadir `pwd`/tmp/3 --commitlog-directory `pwd`/tmp/3 2>&1 | tee /tmp/out3 & ./build/release/seastar -c 1 -m 128M --rpc-address 127.0.0.4 --listen-address 127.0.0.4 --seed-provider-parameters 127.0.0.1 --datadir `pwd`/tmp/4 --commitlog-directory `pwd`/tmp/4 2>&1 | tee /tmp/out4
This commit is contained in:
@@ -110,8 +110,27 @@ future<> storage_service::join_token_ring(int delay) {
|
||||
logger.info("This node will not auto bootstrap because it is configured to be a seed node.");
|
||||
#endif
|
||||
if (should_bootstrap()) {
|
||||
_bootstrap_tokens = boot_strapper::get_bootstrap_tokens(_token_metadata);
|
||||
f = bootstrap(_bootstrap_tokens);
|
||||
auto elapsed = make_shared<int>(0);
|
||||
auto stop_cond = [elapsed, delay] {
|
||||
// FIXME
|
||||
// if we see schema, we can proceed to the next check directly
|
||||
// if (!Schema.instance.getVersion().equals(Schema.emptyVersion)) {
|
||||
// return true;
|
||||
// }
|
||||
if (*elapsed < delay) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
f = do_until(stop_cond, [elapsed] {
|
||||
auto t = 1000;
|
||||
return sleep(std::chrono::milliseconds(t)).then([elapsed, t] {
|
||||
*elapsed += t;
|
||||
});
|
||||
}).then([this] {
|
||||
_bootstrap_tokens = boot_strapper::get_bootstrap_tokens(_token_metadata);
|
||||
bootstrap(_bootstrap_tokens);
|
||||
});
|
||||
#if 0
|
||||
if (SystemKeyspace.bootstrapInProgress())
|
||||
logger.warn("Detected previous bootstrap failure; retrying");
|
||||
|
||||
Reference in New Issue
Block a user