Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip conf version check when peer state is normal & Limit speed about pre-handle snapshot #1671

Merged
merged 1 commit into from
Mar 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contrib/tiflash-proxy
Submodule tiflash-proxy updated 174 files
3 changes: 2 additions & 1 deletion dbms/src/Flash/Coprocessor/InterpreterDAGHelper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ RegionException::RegionReadStatus GetRegionReadStatus(
if (!current_region)
return RegionException::RegionReadStatus::NOT_FOUND;
auto meta_snap = current_region->dumpRegionMetaSnapshot();
if (meta_snap.ver != check_info.region_version || meta_snap.conf_ver != check_info.region_conf_version)
if (meta_snap.ver != check_info.region_version)
return RegionException::RegionReadStatus::EPOCH_NOT_MATCH;
// No need to check conf_version if its peer state is normal
if (current_region->peerState() != raft_serverpb::PeerState::Normal)
return RegionException::RegionReadStatus::NOT_FOUND;

Expand Down
13 changes: 0 additions & 13 deletions dbms/src/Storages/Transaction/LearnerRead.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,6 @@ struct UnavailableRegions
std::atomic<RegionException::RegionReadStatus> status{RegionException::RegionReadStatus::NOT_FOUND};
};

/// Check whether region is invalid or not.
RegionException::RegionReadStatus isValidRegion(const RegionQueryInfo & region_to_query, const RegionPtr & region_in_mem)
{
if (region_in_mem->peerState() != raft_serverpb::PeerState::Normal)
return RegionException::RegionReadStatus::NOT_FOUND;

const auto & meta_snap = region_in_mem->dumpRegionMetaSnapshot();
if (meta_snap.ver != region_to_query.version || meta_snap.conf_ver != region_to_query.conf_version)
return RegionException::RegionReadStatus::EPOCH_NOT_MATCH;

return RegionException::RegionReadStatus::OK;
}

LearnerReadSnapshot doLearnerRead(const TiDB::TableID table_id, //
const MvccQueryInfo & mvcc_query_info, //
size_t num_streams, TMTContext & tmt, Poco::Logger * log)
Expand Down