Adar Dembo has submitted this change and it was merged.

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

Change-Id: I8e24f6035f4d778995ea3f295396f5fbd760d6c6
Reviewed-by: Mike Percy <>
Tested-by: Adar Dembo <>
M src/kudu/master/
M src/kudu/master/catalog_manager.h
2 files changed, 41 insertions(+), 26 deletions(-)

  Mike Percy: Looks good to me, approved
  Adar Dembo: Verified

To view, visit
To unsubscribe, visit

Gerrit-MessageType: merged
Gerrit-Change-Id: I8e24f6035f4d778995ea3f295396f5fbd760d6c6
Gerrit-PatchSet: 8
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Adar Dembo <>
Gerrit-Reviewer: Adar Dembo <>
Gerrit-Reviewer: Jean-Daniel Cryans
Gerrit-Reviewer: Mike Percy <>
Gerrit-Reviewer: Todd Lipcon <>

Reply via email to