You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by to...@apache.org on 2016/12/15 05:22:48 UTC
[1/4] kudu git commit: KUDU-1801: catalog_manager: change TableInfo
lock to a rwlock
Repository: kudu
Updated Branches:
refs/heads/branch-1.2.x eaed73bde -> 1a48ce57a
KUDU-1801: catalog_manager: change TableInfo lock to a rwlock
This lock was showing a lot of contention on a 200-node cluster with
40 concurrent Impala queries. This patch does a straightforward
substitution of a rw spinlock.
I deployed this on the cluster with the same workload and measured
metrics before and after:
Before:
{
"name": "handler_latency_kudu_master_MasterService_GetTableLocations",
"total_count": 10082475,
"min": 7,
"mean": 1229.28,
"percentile_75": 2128,
"percentile_95": 3456,
"percentile_99": 5056,
"percentile_99_9": 7680,
"percentile_99_99": 12928,
"max": 56026,
"total_sum": 12394196985
},
{
"name": "handler_latency_kudu_master_MasterService_GetTableSchema",
"total_count": 8372070,
"min": 18,
"mean": 2121.11,
"percentile_75": 2928,
"percentile_95": 4352,
"percentile_99": 6112,
"percentile_99_9": 9024,
"percentile_99_99": 16896,
"max": 67530,
"total_sum": 17758104544
}
After:
{
"name": "handler_latency_kudu_master_MasterService_GetTableLocations",
"total_count": 1231543,
"min": 2,
"mean": 86.0921,
"percentile_75": 101,
"percentile_95": 139,
"percentile_99": 176,
"percentile_99_9": 258,
"percentile_99_99": 868,
"max": 364560,
"total_sum": 106026108
},
{
"name": "handler_latency_kudu_master_MasterService_GetTableSchema",
"total_count": 1164715,
"min": 2,
"mean": 554.124,
"percentile_75": 620,
"percentile_95": 784,
"percentile_99": 1056,
"percentile_99_9": 1624,
"percentile_99_99": 6176,
"max": 364211,
"total_sum": 645396044
}
Improvement for GetTableLocations:
percentile_99_9: 29.8x
percentile_99_99: 14.9x
min: 3.5x
percentile_95: 24.9x
percentile_75: 21.1x
percentile_99: 28.7x
mean: 14.3x
Improvement for GetTableSchema:
percentile_99_9: 5.6x
percentile_99_99: 2.7x
min: 9.0x
percentile_95: 5.6x
percentile_75: 4.7x
percentile_99: 5.8x
mean: 3.8x
Change-Id: Id77edbf7641275b54010514379cdfff228b408b5
Reviewed-on: http://gerrit.cloudera.org:8080/5471
Reviewed-by: Adar Dembo <ad...@cloudera.com>
Tested-by: Kudu Jenkins
(cherry picked from commit d59a9653a46d40c868c78fac6502e9a24e253731)
Reviewed-on: http://gerrit.cloudera.org:8080/5512
Reviewed-by: Jean-Daniel Cryans <jd...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/61532af7
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/61532af7
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/61532af7
Branch: refs/heads/branch-1.2.x
Commit: 61532af7c9e38f4934d9d8875fdd97bda5dbd09e
Parents: eaed73b
Author: Todd Lipcon <to...@apache.org>
Authored: Sun Dec 11 23:13:27 2016 +0700
Committer: Todd Lipcon <to...@apache.org>
Committed: Thu Dec 15 05:15:56 2016 +0000
----------------------------------------------------------------------
src/kudu/master/catalog_manager.cc | 26 +++++++++++++-------------
src/kudu/master/catalog_manager.h | 6 +++---
2 files changed, 16 insertions(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kudu/blob/61532af7/src/kudu/master/catalog_manager.cc
----------------------------------------------------------------------
diff --git a/src/kudu/master/catalog_manager.cc b/src/kudu/master/catalog_manager.cc
index 7923162..c360730 100644
--- a/src/kudu/master/catalog_manager.cc
+++ b/src/kudu/master/catalog_manager.cc
@@ -3824,17 +3824,17 @@ std::string TableInfo::ToString() const {
}
bool TableInfo::RemoveTablet(const std::string& partition_key_start) {
- std::lock_guard<simple_spinlock> l(lock_);
+ std::lock_guard<rw_spinlock> l(lock_);
return EraseKeyReturnValuePtr(&tablet_map_, partition_key_start) != nullptr;
}
void TableInfo::AddTablet(TabletInfo *tablet) {
- std::lock_guard<simple_spinlock> l(lock_);
+ std::lock_guard<rw_spinlock> l(lock_);
AddTabletUnlocked(tablet);
}
void TableInfo::AddTablets(const vector<TabletInfo*>& tablets) {
- std::lock_guard<simple_spinlock> l(lock_);
+ std::lock_guard<rw_spinlock> l(lock_);
for (TabletInfo *tablet : tablets) {
AddTabletUnlocked(tablet);
}
@@ -3842,7 +3842,7 @@ void TableInfo::AddTablets(const vector<TabletInfo*>& tablets) {
void TableInfo::AddRemoveTablets(const vector<scoped_refptr<TabletInfo>>& tablets_to_add,
const vector<scoped_refptr<TabletInfo>>& tablets_to_drop) {
- std::lock_guard<simple_spinlock> l(lock_);
+ std::lock_guard<rw_spinlock> l(lock_);
for (const auto& tablet : tablets_to_drop) {
const auto& lower_bound = tablet->metadata().state().pb.partition().partition_key_start();
CHECK(EraseKeyReturnValuePtr(&tablet_map_, lower_bound) != nullptr);
@@ -3866,7 +3866,7 @@ void TableInfo::AddTabletUnlocked(TabletInfo* tablet) {
void TableInfo::GetTabletsInRange(const GetTableLocationsRequestPB* req,
vector<scoped_refptr<TabletInfo> > *ret) const {
- std::lock_guard<simple_spinlock> l(lock_);
+ shared_lock<rw_spinlock> l(lock_);
int max_returned_locations = req->max_returned_locations();
TableInfo::TabletInfoMap::const_iterator it, it_end;
@@ -3893,7 +3893,7 @@ void TableInfo::GetTabletsInRange(const GetTableLocationsRequestPB* req,
}
bool TableInfo::IsAlterInProgress(uint32_t version) const {
- std::lock_guard<simple_spinlock> l(lock_);
+ shared_lock<rw_spinlock> l(lock_);
for (const TableInfo::TabletInfoMap::value_type& e : tablet_map_) {
if (e.second->reported_schema_version() < version) {
VLOG(3) << "Table " << table_id_ << " ALTER in progress due to tablet "
@@ -3906,7 +3906,7 @@ bool TableInfo::IsAlterInProgress(uint32_t version) const {
}
bool TableInfo::IsCreateInProgress() const {
- std::lock_guard<simple_spinlock> l(lock_);
+ shared_lock<rw_spinlock> l(lock_);
for (const TableInfo::TabletInfoMap::value_type& e : tablet_map_) {
TabletMetadataLock tablet_lock(e.second, TabletMetadataLock::READ);
if (!tablet_lock.data().is_running()) {
@@ -3919,14 +3919,14 @@ bool TableInfo::IsCreateInProgress() const {
void TableInfo::AddTask(MonitoredTask* task) {
task->AddRef();
{
- std::lock_guard<simple_spinlock> l(lock_);
+ std::lock_guard<rw_spinlock> l(lock_);
pending_tasks_.insert(task);
}
}
void TableInfo::RemoveTask(MonitoredTask* task) {
{
- std::lock_guard<simple_spinlock> l(lock_);
+ std::lock_guard<rw_spinlock> l(lock_);
pending_tasks_.erase(task);
}
@@ -3936,7 +3936,7 @@ void TableInfo::RemoveTask(MonitoredTask* task) {
}
void TableInfo::AbortTasks() {
- std::lock_guard<simple_spinlock> l(lock_);
+ shared_lock<rw_spinlock> l(lock_);
for (MonitoredTask* task : pending_tasks_) {
task->Abort();
}
@@ -3946,7 +3946,7 @@ void TableInfo::WaitTasksCompletion() {
int wait_time = 5;
while (1) {
{
- std::lock_guard<simple_spinlock> l(lock_);
+ shared_lock<rw_spinlock> l(lock_);
if (pending_tasks_.empty()) {
break;
}
@@ -3957,7 +3957,7 @@ void TableInfo::WaitTasksCompletion() {
}
void TableInfo::GetTaskList(std::vector<scoped_refptr<MonitoredTask> > *ret) {
- std::lock_guard<simple_spinlock> l(lock_);
+ shared_lock<rw_spinlock> l(lock_);
for (MonitoredTask* task : pending_tasks_) {
ret->push_back(make_scoped_refptr(task));
}
@@ -3965,7 +3965,7 @@ void TableInfo::GetTaskList(std::vector<scoped_refptr<MonitoredTask> > *ret) {
void TableInfo::GetAllTablets(vector<scoped_refptr<TabletInfo> > *ret) const {
ret->clear();
- std::lock_guard<simple_spinlock> l(lock_);
+ shared_lock<rw_spinlock> l(lock_);
for (const auto& e : tablet_map_) {
ret->push_back(make_scoped_refptr(e.second));
}
http://git-wip-us.apache.org/repos/asf/kudu/blob/61532af7/src/kudu/master/catalog_manager.h
----------------------------------------------------------------------
diff --git a/src/kudu/master/catalog_manager.h b/src/kudu/master/catalog_manager.h
index aa15c1b..3820e86 100644
--- a/src/kudu/master/catalog_manager.h
+++ b/src/kudu/master/catalog_manager.h
@@ -229,13 +229,13 @@ class TableInfo : public RefCountedThreadSafe<TableInfo> {
// Returns a snapshot copy of the table info's tablet map.
TabletInfoMap tablet_map() const {
- std::lock_guard<simple_spinlock> l(lock_);
+ shared_lock<rw_spinlock> l(lock_);
return tablet_map_;
}
// Returns the number of tablets.
int num_tablets() const {
- std::lock_guard<simple_spinlock> l(lock_);
+ shared_lock<rw_spinlock> l(lock_);
return tablet_map_.size();
}
@@ -252,7 +252,7 @@ class TableInfo : public RefCountedThreadSafe<TableInfo> {
TabletInfoMap tablet_map_;
// Protects tablet_map_ and pending_tasks_
- mutable simple_spinlock lock_;
+ mutable rw_spinlock lock_;
CowObject<PersistentTableInfo> metadata_;
[4/4] kudu git commit: Remove gcc/libstdcxx from
thirdparty/LICENSE.txt
Posted by to...@apache.org.
Remove gcc/libstdcxx from thirdparty/LICENSE.txt
We no longer download and build libstdcxx, but forgot to remove this
from the LICENSE.txt file.
Change-Id: I6c040520f701d4b8b4f04176aa03640b38451fea
Reviewed-on: http://gerrit.cloudera.org:8080/5466
Tested-by: Todd Lipcon <to...@apache.org>
Reviewed-by: Adar Dembo <ad...@cloudera.com>
(cherry picked from commit 47905c7e985d0895af3eb16d41247bc1ed81e18f)
Reviewed-on: http://gerrit.cloudera.org:8080/5509
Reviewed-by: Jean-Daniel Cryans <jd...@apache.org>
Tested-by: Kudu Jenkins
Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/1a48ce57
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/1a48ce57
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/1a48ce57
Branch: refs/heads/branch-1.2.x
Commit: 1a48ce57a77db72b63d925d1cc3f1a7f56ce0365
Parents: 7b48066
Author: Todd Lipcon <to...@apache.org>
Authored: Sun Dec 11 22:35:42 2016 +0800
Committer: Todd Lipcon <to...@apache.org>
Committed: Thu Dec 15 05:16:38 2016 +0000
----------------------------------------------------------------------
thirdparty/LICENSE.txt | 5 -----
1 file changed, 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kudu/blob/1a48ce57/thirdparty/LICENSE.txt
----------------------------------------------------------------------
diff --git a/thirdparty/LICENSE.txt b/thirdparty/LICENSE.txt
index ba5c2d5..558daee 100644
--- a/thirdparty/LICENSE.txt
+++ b/thirdparty/LICENSE.txt
@@ -637,11 +637,6 @@ source: https://github.com/gcovr/gcovr
NOTE: optional build-time dependency
--------------------------------------------------------------------------------
-thirdparty/gcc-*/: GPL version 2
-Source: https://gcc.gnu.org
-NOTE: build-time dependency, not linked or bundled.
-
---------------------------------------------------------------------------------
thirdparty/gmock-*/: BSD 3-clause
Source: https://github.com/google/googletest
NOTE: build-time dependency
[3/4] kudu git commit: docs: fix gflag name
Posted by to...@apache.org.
docs: fix gflag name
Change-Id: Ie818b2e641569581ac2936a947311aaed9b1c5e0
Reviewed-on: http://gerrit.cloudera.org:8080/5456
Tested-by: Kudu Jenkins
Reviewed-by: Alexey Serbin <as...@cloudera.com>
Reviewed-by: Todd Lipcon <to...@apache.org>
(cherry picked from commit 2eba7b8846dba70577483f2df1baf0813564383a)
Reviewed-on: http://gerrit.cloudera.org:8080/5510
Reviewed-by: Jean-Daniel Cryans <jd...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/7b480669
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/7b480669
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/7b480669
Branch: refs/heads/branch-1.2.x
Commit: 7b480669591c467c94cc97390272e91f2ee0e511
Parents: 788737f
Author: Adar Dembo <ad...@cloudera.com>
Authored: Fri Dec 9 18:03:54 2016 -0800
Committer: Todd Lipcon <to...@apache.org>
Committed: Thu Dec 15 05:16:25 2016 +0000
----------------------------------------------------------------------
docs/prior_release_notes.adoc | 2 +-
docs/release_notes.adoc | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kudu/blob/7b480669/docs/prior_release_notes.adoc
----------------------------------------------------------------------
diff --git a/docs/prior_release_notes.adoc b/docs/prior_release_notes.adoc
index b18d26b..228592a 100644
--- a/docs/prior_release_notes.adoc
+++ b/docs/prior_release_notes.adoc
@@ -936,7 +936,7 @@ operations will become available in future betas.
The following are known bugs and issues with the current release of Kudu. They will
be addressed in later beta releases.
-* If the Kudu master is configured with the `-log_fsync_all` option, tablet servers
+* If the Kudu master is configured with the `-log_force_fsync_all` option, tablet servers
and clients will experience frequent timeouts, and the cluster may become unusable.
* If a tablet server has a very large number of tablets, it may take several minutes
http://git-wip-us.apache.org/repos/asf/kudu/blob/7b480669/docs/release_notes.adoc
----------------------------------------------------------------------
diff --git a/docs/release_notes.adoc b/docs/release_notes.adoc
index ccc5207..a9aa587 100644
--- a/docs/release_notes.adoc
+++ b/docs/release_notes.adoc
@@ -213,7 +213,7 @@ The following are known bugs and issues with the current release of Kudu. They w
be addressed in later releases. Note that this list is not exhaustive, and is meant
to communicate only the most important known issues.
-* If the Kudu master is configured with the `-log_fsync_all` option, tablet servers
+* If the Kudu master is configured with the `-log_force_fsync_all` option, tablet servers
and clients will experience frequent timeouts, and the cluster may become unusable.
* If a tablet server has a very large number of tablets, it may take several minutes
[2/4] kudu git commit: Modify the default value of log_dir flag.
Posted by to...@apache.org.
Modify the default value of log_dir flag.
The document about configuration says that the default value of
log_dir flag is "/var/log/kudu" but it's "/tmp" in fact.
Change-Id: Icdc6539907e6ba105bf08b0ee349dbeb4089e08d
Reviewed-on: http://gerrit.cloudera.org:8080/5436
Reviewed-by: Todd Lipcon <to...@apache.org>
Tested-by: Kudu Jenkins
(cherry picked from commit 244c6feaed418a4d38eca3d328db4d77d7552471)
Reviewed-on: http://gerrit.cloudera.org:8080/5511
Reviewed-by: Jean-Daniel Cryans <jd...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/788737f5
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/788737f5
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/788737f5
Branch: refs/heads/branch-1.2.x
Commit: 788737f5a537c92adf02d85137c6dec48245b383
Parents: 61532af
Author: Kousuke Saruta <sa...@oss.nttdata.co.jp>
Authored: Fri Dec 9 11:58:40 2016 +0900
Committer: Todd Lipcon <to...@apache.org>
Committed: Thu Dec 15 05:16:06 2016 +0000
----------------------------------------------------------------------
docs/configuration.adoc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kudu/blob/788737f5/docs/configuration.adoc
----------------------------------------------------------------------
diff --git a/docs/configuration.adoc b/docs/configuration.adoc
index 22b591f..53a66ec 100644
--- a/docs/configuration.adoc
+++ b/docs/configuration.adoc
@@ -76,7 +76,7 @@ directories where the Master will place its data blocks.
|--fs_wal_dir | string | | The directory where the Master will
place its write-ahead logs. May be the same as _one of_ the directories listed in
`--fs_data_dirs`, but not a sub-directory of a data directory.
-|--log_dir | string | /var/log/kudu | The directory to store Master log files.
+|--log_dir | string | /tmp | The directory to store Master log files.
|===
For the full list of flags for masters, see the
@@ -98,7 +98,7 @@ of directories where the Tablet Server will place its data blocks.
|--fs_wal_dir | string | | The directory where the Tablet Server will
place its write-ahead logs. May be the same as _one of_ the directories listed in
`--fs_data_dirs`, but not a sub-directory of a data directory.
-|--log_dir | string | /var/log/kudu | The directory to store Tablet Server log files
+|--log_dir | string | /tmp | The directory to store Tablet Server log files
|--tserver_master_addrs | string | `127.0.0.1:7051` | Comma separated
addresses of the masters which the tablet server should connect to. The masters
do not read this flag.