Todd Lipcon has submitted this change and it was merged. ( 
http://gerrit.cloudera.org:8080/8617 )

Change subject: KUDU-2165 workaround: avoid TSAN warnings on CacheMetrics
......................................................................

KUDU-2165 workaround: avoid TSAN warnings on CacheMetrics

InternalMiniCluster tests were spitting out TSAN warnings where one thread
(associated with one mini-tserver) accesses the CacheMetrics while another
thread is busy restarting a tserver. The restarting tserver ends up
replacing the CacheMetrics instance, which caused TSAN to warn due to the
unprotected concurrent access.

This patch is a relatively simple workaround that just prevents the Cache
from switching CacheMetrics instances once it is first constructed. The
underlying metrics are ref-counted, so we shouldn't have any leak or illegal
access. The only downside is that, after a restart, new tservers won't be able
to "attach" to the cache instance. But, we already had somewhat randomly
associated the cache metrics with one of the tablet servers, so it seems
unlikely that any assertions are depending on the functionality.

Along the way, I removed the Cache::NewId() method which was unused.

Change-Id: Ifc5c6e9306df78c364c8b89651ddcc56b90a924f
Reviewed-on: http://gerrit.cloudera.org:8080/8617
Reviewed-by: Mike Percy <mpe...@apache.org>
Tested-by: Todd Lipcon <t...@apache.org>
---
M src/kudu/util/cache-test.cc
M src/kudu/util/cache.cc
M src/kudu/util/cache.h
M src/kudu/util/nvm_cache.cc
4 files changed, 21 insertions(+), 31 deletions(-)

Approvals:
  Mike Percy: Looks good to me, approved
  Todd Lipcon: Verified

--
To view, visit http://gerrit.cloudera.org:8080/8617
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ifc5c6e9306df78c364c8b89651ddcc56b90a924f
Gerrit-Change-Number: 8617
Gerrit-PatchSet: 5
Gerrit-Owner: Todd Lipcon <t...@apache.org>
Gerrit-Reviewer: Andrew Wong <andrew.w...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mpe...@apache.org>
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Todd Lipcon <t...@apache.org>

Reply via email to