Andrew Wong has uploaded this change for review. ( http://gerrit.cloudera.org:8080/17636
Change subject: [master] allow setting BlockCacheMetrics twice ...................................................................... [master] allow setting BlockCacheMetrics twice In some cases, the way we call Cache::SetMetrics() isn't threadsafe. Typically, we only call this once per cache, but this can be a useful call to repeat, e.g. if we're constructing a new server that instantiates its own metric entity but uses the same cache. This usually doesn't happen since most Caches are tied to a single server. However, the BlockCache is special in that it's a singleton, so every instantiation of a server in the same process will use the same cache. This was the cause of KUDU-2165, which was resolved by only allowing the first caller to set the metrics. While it prevented a race, this meant that subsequently started servers would not correctly register metrics. I have an upcoming patch that will start two servers from the same process -- effectively restarting a master after running a tablet copy from the same process as a means to automate the addition of a master to a cluster. To allow this, this patch adds an option to force the resetting of the cache metrics. Change-Id: I4bb9c6f382a26654f2d324676506441f370ffe61 --- M src/kudu/cfile/block_cache.cc M src/kudu/cfile/block_cache.h M src/kudu/master/master-test.cc M src/kudu/master/master.cc M src/kudu/master/master_options.cc M src/kudu/master/master_options.h M src/kudu/master/table_locations_cache.cc M src/kudu/util/cache-test.cc M src/kudu/util/cache.cc M src/kudu/util/cache.h M src/kudu/util/file_cache.cc M src/kudu/util/nvm_cache.cc M src/kudu/util/ttl_cache.h 13 files changed, 97 insertions(+), 18 deletions(-) git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/36/17636/1 -- To view, visit http://gerrit.cloudera.org:8080/17636 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I4bb9c6f382a26654f2d324676506441f370ffe61 Gerrit-Change-Number: 17636 Gerrit-PatchSet: 1 Gerrit-Owner: Andrew Wong <[email protected]>
