chaoyli closed pull request #433: Get rid of choosing one tablet by compaction
URL: https://github.com/apache/incubator-doris/pull/433
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/be/src/olap/merger.cpp b/be/src/olap/merger.cpp
index dfb425d2..b77b9b6b 100644
--- a/be/src/olap/merger.cpp
+++ b/be/src/olap/merger.cpp
@@ -107,7 +107,7 @@ OLAPStatus Merger::merge(const vector<ColumnData*>&
olap_data_arr,
}
if (has_error) {
- LOG(WARNING) << "base compaction failed.";
+ LOG(WARNING) << "compaction failed.";
return OLAP_ERR_OTHER_ERROR;
}
diff --git a/be/src/olap/olap_engine.cpp b/be/src/olap/olap_engine.cpp
index 4d9df32e..7e7a3eb3 100644
--- a/be/src/olap/olap_engine.cpp
+++ b/be/src/olap/olap_engine.cpp
@@ -111,6 +111,7 @@ OLAPEngine::OLAPEngine(const EngineOptions& options)
_effective_cluster_id(-1),
_is_all_cluster_id_exist(true),
_is_drop_tables(false),
+ _tablet_map_lock(RWMutex::Priority::PREFER_WRITING),
_global_table_id(0),
_index_stream_lru_cache(NULL),
_tablet_stat_cache_update_time_ms(0),
@@ -1809,12 +1810,14 @@ void OLAPEngine::perform_cumulative_compaction() {
if (res != OLAP_SUCCESS) {
LOG(WARNING) << "failed to init cumulative compaction."
<< "table=" << best_table->full_name();
+ return;
}
res = cumulative_compaction.run();
if (res != OLAP_SUCCESS) {
LOG(WARNING) << "failed to do cumulative compaction."
<< "table=" << best_table->full_name();
+ return;
}
}
@@ -1834,6 +1837,7 @@ void OLAPEngine::perform_base_compaction() {
if (res != OLAP_SUCCESS) {
LOG(WARNING) << "failed to init base compaction."
<< "table=" << best_table->full_name();
+ return;
}
}
diff --git a/be/src/olap/utils.cpp b/be/src/olap/utils.cpp
index 14ca9e3c..3cefd902 100644
--- a/be/src/olap/utils.cpp
+++ b/be/src/olap/utils.cpp
@@ -1104,11 +1104,11 @@ OLAPStatus Mutex::lock() {
}
OLAPStatus Mutex::trylock() {
- if (0 != pthread_mutex_trylock(&_lock)) {
- VLOG(3) << "failed to got the mutex lock. err=" << strerror(errno);
+ int rv = pthread_mutex_trylock(&_lock);
+ if (rv != 0) {
+ VLOG(3) << "failed to got the mutex lock. error=" << strerror(rv);
return OLAP_ERR_RWLOCK_ERROR;
}
-
return OLAP_SUCCESS;
}
diff --git a/be/src/util/murmur_hash3.cpp b/be/src/util/murmur_hash3.cpp
index faa33ca1..8ee33f62 100644
--- a/be/src/util/murmur_hash3.cpp
+++ b/be/src/util/murmur_hash3.cpp
@@ -1,19 +1,11 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
+//-----------------------------------------------------------------------------
+// MurmurHash3 was written by Austin Appleby, and is placed in the public
+// domain. The author hereby disclaims copyright to this source code.
+
+// Note - The x86 and x64 versions do _not_ produce the same results, as the
+// algorithms are optimized for their respective platforms. You can still
+// compile and run any of them on any platform, but your performance with the
+// non-native version will be less than optimal.
#include "murmur_hash3.h"
diff --git a/be/src/util/murmur_hash3.h b/be/src/util/murmur_hash3.h
index 00c5b3ad..1f1d420a 100644
--- a/be/src/util/murmur_hash3.h
+++ b/be/src/util/murmur_hash3.h
@@ -1,19 +1,6 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
+//-----------------------------------------------------------------------------
+// MurmurHash3 was written by Austin Appleby, and is placed in the public
+// domain. The author hereby disclaims copyright to this source code.
#ifndef DORIS_BE_SRC_UTIL_MURMUR_HASH3_H
#define DORIS_BE_SRC_UTIL_MURMUR_HASH3_H
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]