This is an automated email from the ASF dual-hosted git repository.
lichaoyong pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git
The following commit(s) were added to refs/heads/master by this push:
new 4c5b0b6 Remove VersionHash used to comparison in BE (#2622)
4c5b0b6 is described below
commit 4c5b0b6dc976ecf73669418ec94e9bd25b6776b7
Author: lichaoyong <[email protected]>
AuthorDate: Tue Dec 31 19:38:45 2019 +0800
Remove VersionHash used to comparison in BE (#2622)
---
be/src/exec/olap_scanner.cpp | 14 --------------
be/src/olap/snapshot_manager.cpp | 9 ++-------
be/src/olap/tablet.cpp | 17 -----------------
be/src/olap/tablet.h | 2 --
be/src/olap/task/engine_checksum_task.cpp | 7 -------
5 files changed, 2 insertions(+), 47 deletions(-)
diff --git a/be/src/exec/olap_scanner.cpp b/be/src/exec/olap_scanner.cpp
index 5bb222b..ce6b50b 100644
--- a/be/src/exec/olap_scanner.cpp
+++ b/be/src/exec/olap_scanner.cpp
@@ -78,8 +78,6 @@ Status OlapScanner::_prepare(
strtoul(scan_range.schema_hash.c_str(), nullptr, 10);
_version =
strtoul(scan_range.version.c_str(), nullptr, 10);
- VersionHash version_hash =
- strtoul(scan_range.version_hash.c_str(), nullptr, 10);
{
std::string err;
_tablet =
StorageEngine::instance()->tablet_manager()->get_tablet(tablet_id, schema_hash,
true, &err);
@@ -101,18 +99,6 @@ Status OlapScanner::_prepare(
return Status::InternalError(ss.str());
}
- if (rowset->end_version() == _version
- && rowset->version_hash() != version_hash) {
- LOG(WARNING) << "fail to check latest version hash. "
- << " tablet_id=" << tablet_id
- << " version_hash=" << rowset->version_hash()
- << " request_version_hash=" << version_hash;
-
- std::stringstream ss;
- ss << "fail to check version hash of tablet: " << tablet_id;
- return Status::InternalError(ss.str());
- }
-
// acquire tablet rowset readers at the beginning of the scan node
// to prevent this case: when there are lots of olap scanners to
run for example 10000
// the rowsets maybe compacted when the last olap scanner starts
diff --git a/be/src/olap/snapshot_manager.cpp b/be/src/olap/snapshot_manager.cpp
index f3d9fe5..c630f2e 100644
--- a/be/src/olap/snapshot_manager.cpp
+++ b/be/src/olap/snapshot_manager.cpp
@@ -394,15 +394,10 @@ OLAPStatus SnapshotManager::_create_snapshot_files(
// get snapshot version, use request.version if specified
int32_t version = lastest_version->end_version();
if (request.__isset.version) {
- if (lastest_version->end_version() < request.version
- || (lastest_version->start_version() ==
lastest_version->end_version()
- && lastest_version->end_version() == request.version
- && lastest_version->version_hash() !=
request.version_hash)) {
+ if (lastest_version->end_version() < request.version) {
LOG(WARNING) << "invalid make snapshot request. "
<< " version=" <<
lastest_version->end_version()
- << " version_hash=" <<
lastest_version->version_hash()
- << " req_version=" << request.version
- << " req_version_hash=" <<
request.version_hash;
+ << " req_version=" << request.version;
res = OLAP_ERR_INPUT_PARAMETER_ERROR;
break;
}
diff --git a/be/src/olap/tablet.cpp b/be/src/olap/tablet.cpp
index 495be4a..c81a96d 100644
--- a/be/src/olap/tablet.cpp
+++ b/be/src/olap/tablet.cpp
@@ -711,23 +711,6 @@ const uint32_t Tablet::calc_base_compaction_score() const {
return base_rowset_exist ? score : 0;
}
-OLAPStatus Tablet::compute_all_versions_hash(const vector<Version>& versions,
- VersionHash* version_hash) const {
- DCHECK(version_hash != nullptr) << "invalid parameter, version_hash is
nullptr";
- int64_t v_hash = 0L;
- for (auto version : versions) {
- auto it = _rs_version_map.find(version);
- if (it == _rs_version_map.end()) {
- LOG(WARNING) << "fail to find Rowset. "
- << "version=" << version.first << "-" << version.second;
- return OLAP_ERR_TABLE_VERSION_INDEX_MISMATCH_ERROR;
- }
- v_hash ^= it->second->version_hash();
- }
- *version_hash = v_hash;
- return OLAP_SUCCESS;
-}
-
void Tablet::compute_version_hash_from_rowsets(
const std::vector<RowsetSharedPtr>& rowsets, VersionHash*
version_hash) const {
DCHECK(version_hash != nullptr) << "invalid parameter, version_hash is
nullptr";
diff --git a/be/src/olap/tablet.h b/be/src/olap/tablet.h
index 29cf5e1..d543ef9 100644
--- a/be/src/olap/tablet.h
+++ b/be/src/olap/tablet.h
@@ -182,8 +182,6 @@ public:
bool can_do_compaction();
const uint32_t calc_cumulative_compaction_score() const;
const uint32_t calc_base_compaction_score() const;
- OLAPStatus compute_all_versions_hash(const std::vector<Version>& versions,
- VersionHash* version_hash) const;
void compute_version_hash_from_rowsets(const std::vector<RowsetSharedPtr>&
rowsets,
VersionHash* version_hash) const;
diff --git a/be/src/olap/task/engine_checksum_task.cpp
b/be/src/olap/task/engine_checksum_task.cpp
index eb2f312..c8ca28f 100644
--- a/be/src/olap/task/engine_checksum_task.cpp
+++ b/be/src/olap/task/engine_checksum_task.cpp
@@ -72,13 +72,6 @@ OLAPStatus EngineChecksumTask::_compute_checksum() {
return OLAP_ERR_VERSION_NOT_EXIST;
}
- if (message->end_version() == _version
- && message->version_hash() != _version_hash) {
- OLAP_LOG_WARNING("fail to check latest version hash. "
- "[res=%d tablet_id=%ld version_hash=%ld
request_version_hash=%ld]",
- res, _tablet_id, message->version_hash(),
_version_hash);
- return OLAP_ERR_CE_CMD_PARAMS_ERROR;
- }
OLAPStatus acquire_reader_st =
tablet->capture_rs_readers(reader_params.version, &reader_params.rs_readers);
if (acquire_reader_st != OLAP_SUCCESS) {
LOG(WARNING) << "fail to init reader. tablet=" <<
tablet->full_name()
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]