Skip to content

Commit 124972f

Browse files
committed
debug
Signed-off-by: Ping Yu <yuping@pingcap.com>
1 parent bc1ac81 commit 124972f

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/kv/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub use key::Key;
1414
pub use kvpair::KvPair;
1515
pub use value::Value;
1616

17-
struct HexRepr<'a>(pub &'a [u8]);
17+
pub struct HexRepr<'a>(pub &'a [u8]);
1818

1919
impl<'a> fmt::Display for HexRepr<'a> {
2020
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {

src/transaction/lock.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@ use std::sync::Arc;
77
use fail::fail_point;
88
use log::debug;
99
use log::error;
10+
use log::info;
1011
use log::warn;
1112
use tokio::sync::RwLock;
1213
use tokio::time::sleep;
1314

1415
use crate::backoff::Backoff;
1516
use crate::backoff::DEFAULT_REGION_BACKOFF;
1617
use crate::backoff::OPTIMISTIC_BACKOFF;
18+
use crate::kv::HexRepr;
1719
use crate::pd::PdClient;
1820
use crate::proto::kvrpcpb;
1921
use crate::proto::kvrpcpb::TxnInfo;
@@ -378,7 +380,7 @@ impl LockResolver {
378380
// 2.2 Txn Rollbacked -- rollback itself, rollback by others, GC tomb etc.
379381
// 2.3 No lock -- pessimistic lock rollback, concurrence prewrite.
380382
let req = new_check_txn_status_request(
381-
primary,
383+
primary.clone(),
382384
txn_id,
383385
caller_start_ts,
384386
current_ts,
@@ -414,6 +416,8 @@ impl LockResolver {
414416

415417
let current = pd_client.clone().get_timestamp().await?;
416418
status.check_ttl(current);
419+
info!("check_txn_status: primary {}, status {:?}", HexRepr(&primary), status);
420+
417421
let res = Arc::new(status);
418422
if res.is_cacheable() {
419423
self.ctx.save_resolved(txn_id, res.clone()).await;

0 commit comments

Comments
 (0)