fix(lock): split distributed read and write quorum (#2355)

This commit is contained in:
weisd
2026-03-31 16:16:13 +08:00
committed by GitHub
parent 15995aae14
commit e86c6b726f
6 changed files with 997 additions and 19 deletions
+3 -2
View File
@@ -151,8 +151,9 @@ impl NamespaceLock {
Self::Distributed(DistributedLock::new(namespace, clients, quorum))
}
/// Create namespace lock with clients and an explicit quorum size.
/// Quorum will be clamped into [1, clients.len()].
/// Create namespace lock with clients and an explicit write quorum size.
/// Shared/read locks still use the distributed read quorum derived from client count.
/// The write quorum will be clamped into [1, clients.len()].
pub fn with_clients_and_quorum(namespace: String, clients: Vec<Arc<dyn LockClient>>, quorum: usize) -> Self {
Self::Distributed(DistributedLock::new(namespace, clients, quorum))
}