TxnLockNotFound
还没有人认领这个 Issue。
- #316 来自 @gfreezy —— 已关闭,未合并
评估
调研方向
从使用 TransactionClient、begin_optimistic、insert、delete 和 commit 的 Rust 复现开始,重点关注 src/main.rs:347 处失败的调用。针对所述的 TiKV 设置复现 TxnLockNotFound 错误,然后跟踪事务提交路径,以确定为什么已插入并删除的键会丢失其 lock。完成的标准是该序列成功提交,或报告一个得到明确处理的结果。
由索引模型根据 Issue 内容生成。
描述
#[tokio::main]
async fn main() -> Result<()> {
let txn_client = TransactionClient::new(vec!["127.0.0.1:2379"]).await?;
let mut txn = txn_client.begin_optimistic().await.unwrap();
let key = "aa".to_owned();
txn.insert(key.clone(), "value".to_owned()).await.unwrap();
txn.delete(key.clone()).await.unwrap();
txn.commit().await.unwrap();
Ok(())
}
The above code raise the following error:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: StringError("KeyError { locked: None, retryable: \"Error(Txn(Error(Mvcc(Error(TxnLockNotFound { start_ts: TimeStamp(427084398190919681), commit_ts: TimeStamp(427084398190919682), key: [97, 97] })))))\", abort: \"\", conflict: None, already_exist: None, deadlock: None, commit_ts_expired: None, txn_not_found: None, commit_ts_too_large: None }")', src/main.rs:347:24
stack backtrace:
0: rust_begin_unwind
at /rustc/ae90dcf0207c57c3034f00b07048d63f8b2363c8/library/std/src/panicking.rs:517:5
1: core::panicking::panic_fmt
at /rustc/ae90dcf0207c57c3034f00b07048d63f8b2363c8/library/core/src/panicking.rs:93:14
2: core::result::unwrap_failed
at /rustc/ae90dcf0207c57c3034f00b07048d63f8b2363c8/library/core/src/result.rs:1617:5
3: core::result::Result<T,E>::unwrap
at /rustc/ae90dcf0207c57c3034f00b07048d63f8b2363c8/library/core/src/result.rs:1299:23
4: scratch::main::{{closure}}
at ./src/main.rs:347:5
5: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
at /rustc/ae90dcf0207c57c3034f00b07048d63f8b2363c8/library/core/src/future/mod.rs:80:19
6: tokio::park::thread::CachedParkThread::block_on::{{closure}}
at /Users/feichao/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.10.0/src/park/thread.rs:263:54
7: tokio::coop::with_budget::{{closure}}
at /Users/feichao/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.10.0/src/coop.rs:106:9
8: std::thread::local::LocalKey<T>::try_with
at /rustc/ae90dcf0207c57c3034f00b07048d63f8b2363c8/library/std/src/thread/local.rs:399:16
9: std::thread::local::LocalKey<T>::with
at /rustc/ae90dcf0207c57c3034f00b07048d63f8b2363c8/library/std/src/thread/local.rs:375:9
10: tokio::coop::with_budget
at /Users/feichao/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.10.0/src/coop.rs:99:5
11: tokio::coop::budget
at /Users/feichao/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.10.0/src/coop.rs:76:5
12: tokio::park::thread::CachedParkThread::block_on
at /Users/feichao/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.10.0/src/park/thread.rs:263:31
13: tokio::runtime::enter::Enter::block_on
at /Users/feichao/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.10.0/src/runtime/enter.rs:151:13
14: tokio::runtime::thread_pool::ThreadPool::block_on
at /Users/feichao/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.10.0/src/runtime/thread_pool/mod.rs:71:9
15: tokio::runtime::Runtime::block_on
at /Users/feichao/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.10.0/src/runtime/mod.rs:452:43
16: scratch::main
at ./src/main.rs:348:5
17: core::ops::function::FnOnce::call_once
at /rustc/ae90dcf0207c57c3034f00b07048d63f8b2363c8/library/core/src/ops/function.rs:227:5
Tikv setup:

- 主要语言
- Rust
- 星标
- 434
- 派生
- 168
- 平均合并
- 4 天 12 小时
- 30 天内合并 PR
- 2
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
tikv/client-rust 的其他 Issue
-
contribution
难度 5/5 一周以上 新手友好度 35/100
tikv/client-rust#546 ·
-
contribution first-time-contributor
难度 4/5 3-5 天 新手友好度 35/100
tikv/client-rust#531 · 1 条评论 ·
-
Resolve lock bug未关闭contribution first-time-contributor
难度 4/5 3-5 天 新手友好度 35/100
tikv/client-rust#528 · 4 条评论 ·
-
难度 4/5 3-5 天 新手友好度 42/100
tikv/client-rust#516 · 1 条评论 ·
-
Reverse scan fail to find key when range spans multi region可能已有人在做 @lance6716 于 33 天前认领。 未关闭contribution first-time-contributor
难度 4/5 3-5 天 新手友好度 20/100
tikv/client-rust#512 · 5 条评论 ·
相似的 Issue
-
难度 1/5 1-3 小时 新手友好度 64/100
storytold/designcraft#3477 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
agent-labs-dev/mergeloop#374 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 1 天内回复
-
area:plugins kind:bug priority:p3 ready
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
quarto-dev/q2#1446 ·
维护者通常 1 天内回复