Skip to content

Commit

Permalink
Fix stale read in testing scenario (#6526)
Browse files Browse the repository at this point in the history
close #6525
  • Loading branch information
hehechen authored Dec 22, 2022
1 parent 2ea6253 commit 0866058
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dbms/src/Storages/Transaction/LearnerRead.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ LearnerReadSnapshot doLearnerRead(
const auto & region_to_query = regions_info[region_idx];
const RegionID region_id = region_to_query.region_id;
UInt64 physical_tso = read_index_tso >> TsoPhysicalShiftBits;
bool can_stale_read = physical_tso < region_table.getSelfSafeTS(region_id);
bool can_stale_read = mvcc_query_info->read_tso != std::numeric_limits<uint64_t>::max() && physical_tso < region_table.getSelfSafeTS(region_id);
if (!can_stale_read)
{
if (auto ori_read_index = mvcc_query_info.getReadIndexRes(region_id); ori_read_index)
Expand Down

0 comments on commit 0866058

Please sign in to comment.