fix compile issue

Signed-off-by: haojinming <jinming.hao@pingcap.com>
This commit is contained in:
haojinming 2023-01-03 10:28:55 +08:00
parent 8c14194894
commit bb26361c9f
4 changed files with 5 additions and 5 deletions

View File

@ -502,7 +502,7 @@ impl<P: Plan, PdC: PdClient> Clone for CleanupLocks<P, PdC> {
logger: self.logger.clone(),
inner: self.inner.clone(),
ctx: self.ctx.clone(),
options: self.options,
options: self.options.clone(),
store: None,
pd_client: self.pd_client.clone(),
backoff: self.backoff.clone(),

View File

@ -13,7 +13,7 @@ use crate::{
Backoff, Result,
};
use slog::{Drain, Logger};
use std::{mem, sync::Arc};
use std::sync::Arc;
use tikv_client_proto::pdpb::Timestamp;
// FIXME: cargo-culted value
@ -263,7 +263,6 @@ impl Client {
) -> Result<CleanupLocksResult> {
debug!(self.logger, "invoking cleanup async commit locks");
// scan all locks with ts <= safepoint
let mut start_key = vec![];
let ctx = ResolveLocksContext::default();
let backoff = Backoff::equal_jitter_backoff(100, 10000, 50);
let req = new_scan_lock_request(
@ -291,7 +290,7 @@ impl Client {
batch_size: u32,
) -> Result<Vec<tikv_client_proto::kvrpcpb::LockInfo>> {
let req = new_scan_lock_request(
mem::take(&mut start_key),
std::mem::take(&mut start_key),
vec![],
safepoint.version(),
batch_size,

View File

@ -149,7 +149,7 @@ pub struct ResolveLocksContext {
pub(crate) clean_regions: Arc<RwLock<HashMap<u64, HashSet<RegionVerId>>>>,
}
#[derive(Clone, Copy, Debug)]
#[derive(Clone, Debug)]
pub struct ResolveLocksOptions {
pub async_commit_only: bool,
pub start_key: Vec<u8>,

View File

@ -99,6 +99,7 @@ async fn txn_cleanup_locks_batch_size() -> Result<()> {
let options = ResolveLocksOptions {
async_commit_only: false,
batch_size: 4,
..Default::default()
};
let res = client.cleanup_locks(&safepoint, options).await?;