fix: make max-txn-ops limit valid (#3481)

This commit is contained in:
JeremyHi
2024-03-11 17:27:51 +08:00
committed by GitHub
parent aa953dcc34
commit da098f5568
5 changed files with 17 additions and 1 deletions

View File

@@ -45,6 +45,10 @@ impl TxnService for ChrootKvBackend {
let txn_res = self.inner.txn(txn).await?;
Ok(self.chroot_txn_response(txn_res))
}
fn max_txn_ops(&self) -> usize {
self.inner.max_txn_ops()
}
}
#[async_trait::async_trait]

View File

@@ -323,6 +323,10 @@ impl<T: ErrorExt + Send + Sync> TxnService for MemoryKvBackend<T> {
responses,
})
}
fn max_txn_ops(&self) -> usize {
usize::MAX
}
}
impl<T: ErrorExt + Send + Sync + 'static> ResettableKvBackend for MemoryKvBackend<T> {

View File

@@ -30,7 +30,7 @@ pub trait TxnService: Sync + Send {
/// Maximum number of operations permitted in a transaction.
fn max_txn_ops(&self) -> usize {
usize::MAX
unimplemented!("txn is not implemented")
}
}

View File

@@ -152,6 +152,10 @@ impl TxnService for RaftEngineBackend {
responses,
})
}
fn max_txn_ops(&self) -> usize {
usize::MAX
}
}
#[async_trait::async_trait]

View File

@@ -380,6 +380,10 @@ impl TxnService for LeaderCachedKvBackend {
Ok(res)
}
fn max_txn_ops(&self) -> usize {
self.store.max_txn_ops()
}
}
impl ResettableKvBackend for LeaderCachedKvBackend {