mirror of
https://github.com/telemt/telemt.git
synced 2026-11-02 22:02:00 +03:00
ME: Autonomous&Lifecycle-bounded Pool Convergence
Co-Authored-By: brekotis <93345790+brekotis@users.noreply.github.com>
This commit is contained in:
@@ -491,7 +491,11 @@ impl MePool {
|
||||
rand::rng().random_range(min_ms..=max_ms)
|
||||
}
|
||||
|
||||
pub(super) fn hardswap_warmup_backoff_ms(&self, pass_idx: usize) -> u64 {
|
||||
/// Returns capped exponential retry delay with bounded positive jitter.
|
||||
pub(in crate::transport::middle_proxy) fn hardswap_warmup_backoff_ms(
|
||||
&self,
|
||||
pass_idx: usize,
|
||||
) -> u64 {
|
||||
let base_ms = self
|
||||
.reinit
|
||||
.me_hardswap_warmup_pass_backoff_base_ms
|
||||
|
||||
@@ -169,11 +169,21 @@ impl MePool {
|
||||
}
|
||||
}
|
||||
|
||||
/// Reconciles one immutable endpoint snapshot without draining uncovered groups.
|
||||
pub async fn zero_downtime_reinit_after_map_change(
|
||||
self: &Arc<Self>,
|
||||
rng: &SecureRandom,
|
||||
) -> bool {
|
||||
let endpoint_snapshot = self.endpoint_snapshot.load_full();
|
||||
self.reinit_endpoint_snapshot(rng, endpoint_snapshot).await
|
||||
}
|
||||
|
||||
/// Reconciles exactly the revision owned by the scheduler's retry objective.
|
||||
pub(in crate::transport::middle_proxy) async fn reinit_endpoint_snapshot(
|
||||
self: &Arc<Self>,
|
||||
rng: &SecureRandom,
|
||||
endpoint_snapshot: Arc<EndpointSnapshot>,
|
||||
) -> bool {
|
||||
let desired_by_dc = self.desired_dc_endpoints_from_snapshot(&endpoint_snapshot);
|
||||
let now_epoch_secs = Self::now_epoch_secs();
|
||||
let v4_suppressed = self.is_family_temporarily_suppressed(IpFamily::V4, now_epoch_secs);
|
||||
@@ -407,6 +417,7 @@ impl MePool {
|
||||
true
|
||||
}
|
||||
|
||||
/// Applies periodic rotation using the same coverage and generation fences as map changes.
|
||||
pub async fn zero_downtime_reinit_periodic(self: &Arc<Self>, rng: &SecureRandom) -> bool {
|
||||
self.zero_downtime_reinit_after_map_change(rng).await
|
||||
}
|
||||
|
||||
@@ -149,6 +149,7 @@ fn stale_concurrent_attempt_cannot_regress_active_generation() {
|
||||
active_generation: 1,
|
||||
desired_map_hash: 22,
|
||||
endpoint_revision: 7,
|
||||
floor_policy_revision: 1,
|
||||
pending: Some(ReinitPendingState {
|
||||
generation: 3,
|
||||
started_at_epoch_secs: 1,
|
||||
|
||||
Reference in New Issue
Block a user