tikv / tikv/client-c

txn throw exception Region epoch not match after retries

Open
#75 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
41
Forks
56
Avg merge
5m
Merged PRs (30d)
2

Description

./pd-server --version
Release Version: v4.0.0-rc.2-563-gaa22efb5-dirty
Edition: Community
Git Commit Hash: aa22efb50906e2d0fb1306bd2af6813969e46d73
Git Branch: master
UTC Build Time: 2021-05-27 04:38:59

Release Version: 5.1.0-alpha
Edition: Community
Git Commit Hash: cd905a208293c2b0c1fca9aa2756d5c26392b38c
Git Commit Branch: master
UTC Build Time: 2021-05-28 09:25:25
Rust Version: rustc 1.53.0-nightly (16bf626a3 2021-04-14)
Enable Features: jemalloc mem-profiling portable sse protobuf-codec test-engines-rocksdb cloud-aws cloud-gcp
Profile: release

src:
count=1000000
Txn txn(test_cluster.get());

try{
    char keyName[32];
    std::string keyValue( 512, 'x');

    auto begin_tm = timeSinceEpochMillisec();
    for( int i = 1;i<=count;i++){
        sprintf(keyName, "c%d", i);
        txn.set(keyName, keyValue);
    }
    txn.commit();
    auto end_tm = timeSinceEpochMillisec();
    printf("time:%ld\n", end_tm- begin_tm);
}
catch ( Exception & e) {
    std::cerr << "exception caught: " << e.displayText() << '\n';
}

[19:42:06] [(0)] Information: load store id 2001 address 172.16.16.21:20160
[19:43:33] [(0)] Warning: region {44103,3,29} find error: EpochNotMatch current epoch of region 44103 is conf_ver: 3 version: 30
[19:43:33] [(0)] Information: region stale for region {44103,3,29}.
[19:43:33] [(0)] Information: try drop region {44103,3,29}
[19:43:33] [(0)] Information: drop region 44103 because of send failure
[19:43:33] [(0)] Warning: region {44127,3,30} find error: peer is not leader for region 44127, leader may None
[19:43:33] [(0)] Information: report not leader but doesn't have new leader
[19:43:33] [(0)] Information: try drop region {44127,3,30}
[19:43:33] [(0)] Information: drop region 44127 because of send failure
[19:43:53] [(0)] Warning: write commit exception: Exception: Region epoch not match after retries: Region {44103,3,29} not in region cache.
exception caught: Exception: Region epoch not match after retries: Region {44103,3,29} not in region cache.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the C++ transaction shown in the report and trace txn.commit through its region-cache retry handling, using the EpochNotMatch and not-leader log messages as checkpoints. Done means the reported workload no longer throws “Region epoch not match after retries,” with a regression test covering the retry scenario; the report names no source files or existing tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
databases, distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.