Hello Mike Percy,

I'd like you to do a code review.  Please visit

    http://gerrit.cloudera.org:8080/3460

to review the following change.

Change subject: KUDU-1473: fix some tablet lock usage in CatalogManager
......................................................................

KUDU-1473: fix some tablet lock usage in CatalogManager

This was probably due to the refactoring done in commit 59ff89d. Now that
we're releasing tablet write locks as early as possible, we need to
reacquire them (in read mode) for some operations.

The lock misuse reared its head most often in the Java test
TestKuduTable.testGetLocations, but could trigger in just about any test
that didn't wait for table creation to finish before accessing the table.
For example, CreateTableITest.TestCreateWhenMajorityOfReplicasFailCreation
was a little flaky too. The backtrace was always the same:

cow_object.h:82] Check failed: lock_.HasReaders() || lock_.HasWriteLock()
    @     0x7fecb643e37b  kudu::CowObject<>::state() at ??:0
    @     0x7fecb6422fe9  
kudu::master::CatalogManager::ProcessPendingAssignments() at ??:0
    @     0x7fecb6421d3a  kudu::master::CatalogManagerBgTasks::Run() at ??:0
    @     0x7fecb645c1f7  boost::_mfi::mf0<>::operator()() at ??:0
    @     0x7fecb645c15b  boost::_bi::list1<>::operator()<>() at ??:0
    @     0x7fecb645c104  boost::_bi::bind_t<>::operator()() at ??:0
    @     0x7fecb645bf2a  
boost::detail::function::void_function_obj_invoker0<>::invoke() at ??:0
    @     0x7fecb0b66d82  boost::function0<>::operator()() at ??:0
    @     0x7fecafba96c0  kudu::Thread::SuperviseThread() at ??:0
    @           0x423faa  __tsan_thread_start_func at ??:0
    @     0x7fecb28459d1  start_thread at ??:0
    @     0x7fecacd108fd  clone at ??:0

Note: on branch-0.9.x, SendDeleteTabletRequest() does not need to acquire a
tablet lock because it still uses the per-tablet replica cache which has
since been removed on master.

Change-Id: I8e24f6035f4d778995ea3f295396f5fbd760d6c6
Reviewed-on: http://gerrit.cloudera.org:8080/3309
Reviewed-by: Mike Percy <mpe...@apache.org>
Tested-by: Adar Dembo <a...@cloudera.com>
(cherry picked from commit 679c6b2c93313bd4371916678b4ea8f52b621a50)
---
M src/kudu/master/catalog_manager.cc
M src/kudu/master/catalog_manager.h
2 files changed, 33 insertions(+), 22 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/60/3460/1
-- 
To view, visit http://gerrit.cloudera.org:8080/3460
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8e24f6035f4d778995ea3f295396f5fbd760d6c6
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: branch-0.9.x
Gerrit-Owner: Adar Dembo <a...@cloudera.com>
Gerrit-Reviewer: Mike Percy <mpe...@apache.org>

Reply via email to