fix(pool): enhance reconnect logic for single-endpoint data centers

This commit is contained in:
miniusercoder
2026-04-06 21:06:53 +03:00
parent 86be0d53fe
commit 2b8159a65e
3 changed files with 51 additions and 11 deletions

View File

@@ -1674,7 +1674,16 @@ impl MePool {
let active_for_dc = {
let ws = self.writers.read().await;
ws.iter()
.filter(|w| !w.draining.load(std::sync::atomic::Ordering::Relaxed) && w.writer_dc == writer_dc)
.filter(|w| {
!w.draining.load(std::sync::atomic::Ordering::Relaxed)
&& w.writer_dc == writer_dc
&& matches!(
WriterContour::from_u8(
w.contour.load(std::sync::atomic::Ordering::Relaxed),
),
WriterContour::Active
)
})
.count()
};
if active_for_dc < base_req {