Fixed - failover handling in Sentinel mode #6219

pull/6394/head
Nikita Koksharov 3 weeks ago
parent 28d53efc76
commit b6f52744c8

@ -364,13 +364,12 @@ public class SentinelConnectionManager extends MasterSlaveConnectionManager {
private void updateState(SentinelServersConfig cfg, RedisConnection connection, Iterator<RedisClient> iterator, private void updateState(SentinelServersConfig cfg, RedisConnection connection, Iterator<RedisClient> iterator,
AtomicReference<Throwable> lastException) { AtomicReference<Throwable> lastException) {
List<CompletableFuture<?>> futures = new ArrayList<>(); List<CompletableFuture<?>> futures = new ArrayList<>();
CompletionStage<RedisClient> masterFuture = checkMasterChange(cfg, connection); CompletionStage<?> f = checkMasterChange(cfg, connection);
futures.add(masterFuture.toCompletableFuture());
if (!config.isSlaveNotUsed()) { if (!config.isSlaveNotUsed()) {
CompletionStage<Void> slavesFuture = checkSlavesChange(cfg, connection); f = f.thenCompose(r -> checkSlavesChange(cfg, connection));
futures.add(slavesFuture.toCompletableFuture());
} }
futures.add(f.toCompletableFuture());
CompletionStage<Void> sentinelsFuture = checkSentinelsChange(cfg, connection); CompletionStage<Void> sentinelsFuture = checkSentinelsChange(cfg, connection);
futures.add(sentinelsFuture.toCompletableFuture()); futures.add(sentinelsFuture.toCompletableFuture());

Loading…
Cancel
Save