mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-27 18:30:38 +00:00
fix: make max-txn-ops limit valid (#3481)
This commit is contained in:
@@ -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]
|
||||
|
||||
@@ -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> {
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -152,6 +152,10 @@ impl TxnService for RaftEngineBackend {
|
||||
responses,
|
||||
})
|
||||
}
|
||||
|
||||
fn max_txn_ops(&self) -> usize {
|
||||
usize::MAX
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait::async_trait]
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user