Atomic Lifecycle for Writer Refresh + Hardswap

This commit is contained in:
Alexey
2026-09-12 20:14:41 +03:00
parent 54197e848a
commit 1ea5f7a1d6
44 changed files with 3020 additions and 581 deletions
@@ -22,6 +22,7 @@ pub(super) async fn live_active_writers_for_dc_family(
dc: i32,
family: IpFamily,
) -> usize {
let active_generation = pool.current_generation();
let writers = pool.writers.read().await;
writers
.iter()
@@ -32,6 +33,9 @@ pub(super) async fn live_active_writers_for_dc_family(
if writer.writer_dc != dc {
return false;
}
if writer.generation != active_generation {
return false;
}
if !matches!(
crate::transport::middle_proxy::pool::WriterContour::from_u8(
writer.contour.load(std::sync::atomic::Ordering::Relaxed),