fix(admin): report refreshed lock lease TTLs (#6230)

This commit is contained in:
cxymds
2026-08-19 11:02:07 +08:00
committed by GitHub
parent aa6b9001f1
commit 13a9d19505
7 changed files with 491 additions and 69 deletions
+8 -1
View File
@@ -15,7 +15,7 @@
pub mod local;
// pub mod remote;
use crate::{LockId, LockInfo, LockRequest, LockResponse, LockStats, Result};
use crate::{LockId, LockInfo, LockLeaseInfo, LockRequest, LockResponse, LockStats, Result};
use async_trait::async_trait;
use futures::future::join_all;
use std::sync::Arc;
@@ -54,6 +54,13 @@ pub trait LockClient: Send + Sync + std::fmt::Debug {
/// Check lock status
async fn check_status(&self, lock_id: &LockId) -> Result<Option<LockInfo>>;
/// Return authoritative lease information when this client owns lease state.
///
/// Clients that do not manage renewable leases return an empty snapshot.
async fn list_lock_leases(&self) -> Vec<LockLeaseInfo> {
Vec::new()
}
/// Get statistics
async fn get_stats(&self) -> Result<LockStats>;