TxnLockNotFound
Chưa có ai nhận issue này.
- #316 của @gfreezy — đã đóng, không merge
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Bắt đầu bằng việc tái hiện trong Rust sử dụng TransactionClient, begin_optimistic, insert, delete và commit, tập trung vào lời gọi bị lỗi tại src/main.rs:347. Tái hiện lỗi TxnLockNotFound với thiết lập TiKV được mô tả, sau đó lần theo đường dẫn commit của giao dịch để xác định tại sao khóa đã được chèn rồi xóa lại mất lock. Hoàn tất khi chuỗi này commit thành công hoặc báo cáo một kết quả được xử lý rõ ràng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
#[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:

- Ngôn ngữ chính
- Rust
- Star
- 434
- Fork
- 168
- Merge trung bình
- 4 ngày 12 giờ
- Pull request đã merge (30 ngày)
- 2
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của tikv/client-rust
-
contribution
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
tikv/client-rust#546 ·
-
Disable TSO for raw clients?Đang mởcontribution first-time-contributor
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
tikv/client-rust#531 · 1 bình luận ·
-
Resolve lock bugĐang mởcontribution first-time-contributor
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
tikv/client-rust#528 · 4 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
tikv/client-rust#516 · 1 bình luận ·
-
Reverse scan fail to find key when range spans multi regionCó thể đã có người làm @lance6716 đã nhận 33 ngày trước. Đang mởcontribution first-time-contributor
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 20/100
tikv/client-rust#512 · 5 bình luận ·
Tất cả issue của tikv/client-rust
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
quarto-dev/q2#1446 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
ProvableHQ/snarkOS#4817 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
facebookexperimental/reverie#193 ·
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
pbakaus/impeccable#1748 ·
Maintainer thường phản hồi trong vòng 1 ngày