We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a68071d commit 8ef81ccCopy full SHA for 8ef81cc
src/pool.rs
@@ -943,11 +943,17 @@ impl ConnectionPool {
943
944
debug!("Available targets: {}", replicas_available);
945
946
+ let has_primary = self.addresses[address.shard]
947
+ .iter()
948
+ .filter(|addr| addr.role == Role::Primary)
949
+ .count()
950
+ == 1;
951
+
952
let read_guard = self.banlist.read();
953
let all_replicas_banned = read_guard[address.shard].len() == replicas_available;
954
drop(read_guard);
955
- if all_replicas_banned {
956
+ if all_replicas_banned && !has_primary {
957
let mut write_guard = self.banlist.write();
958
warn!("Unbanning all replicas.");
959
write_guard[address.shard].clear();
0 commit comments