Skip to content

Commit

Permalink
Fix a doomed assert in WaitCheckRegionReady (#6710)
Browse files Browse the repository at this point in the history
close #6695
  • Loading branch information
CalvinNeo authored Feb 2, 2023
1 parent f883041 commit 28d3c41
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion dbms/src/Storages/Transaction/KVStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -709,11 +709,17 @@ void WaitCheckRegionReady(
const auto & region_error = resp.region_error();
if (region_error.has_region_not_found() || region_error.has_epoch_not_match())
need_retry = false;
LOG_DEBUG(log,
"neglect error region {} not found {} epoch not match {}",
region_id,
region_error.has_region_not_found(),
region_error.has_epoch_not_match());
}
if (!need_retry)
{
// `read_index` can be zero if region error happens.
// It is not worthy waiting applying and reading index again.
// if region is able to get latest commit-index from TiKV, we should make it available only after it has caught up.
assert(resp.read_index() != 0);
regions_to_check.emplace(region_id, resp.read_index());
remain_regions.erase(region_id);
}
Expand Down

0 comments on commit 28d3c41

Please sign in to comment.