Alexey Serbin has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/16137 )

Change subject: Optimize GetTableLocations for better arena use
......................................................................


Patch Set 10:

ASAN-related failure seems relevant: it seems TSInfoDict-related memory is 
leaking with new  changes.  TSInfosDict is also used in 
AutoRebalancerTask::GetTabletLeader() (see auto_rebalancer.cc), so that dance 
with STLDeleteElements is necessary there as well.

>From the other side, maybe it's worth introducing an additional constructor 
>for TSInfosDict or an additional  class for TSInfosDict to be used outside of 
>the CatalogManager.

=================================================================
==29702==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 658080 byte(s) in 9140 object(s) allocated from:
    #0 0x534188 in operator new(unsigned long) 
/home/jenkins-slave/workspace/kudu-master/0/thirdparty/src/llvm-9.0.0.src/projects/compiler-rt/lib/asan/asan_new_delete.cc:99
    #1 0x7f35d3eb564f in kudu::master::TSInfoPB* 
google::protobuf::Arena::CreateMessageInternal<kudu::master::TSInfoPB>(google::protobuf::Arena*)
 
/home/jenkins-slave/workspace/kudu-master/0/thirdparty/installed/uninstrumented/include/google/protobuf/arena.h:501:14
    #2 0x7f35d3eb564f in kudu::master::TSInfoPB* 
google::protobuf::Arena::CreateMaybeMessage<kudu::master::TSInfoPB>(google::protobuf::Arena*)
 
/home/jenkins-slave/workspace/kudu-master/0/build/asan/src/kudu/master/master.pb.cc:24126:10
    #3 0x7f35db7187f9 in kudu::master::TSInfoPB* 
google::protobuf::Arena::CreateMessage<kudu::master::TSInfoPB>(google::protobuf::Arena*)
 
/home/jenkins-slave/workspace/kudu-master/0/thirdparty/installed/uninstrumented/include/google/protobuf/arena.h:304:12
    #4 0x7f35db7187f9 in 
kudu::master::CatalogManager::BuildLocationsForTablet(scoped_refptr<kudu::master::TabletInfo>
 const&, kudu::master::ReplicaTypeFilter, kudu::master::TabletLocationsPB*, 
kudu::master::CatalogManager::TSInfosDict*)::$_30::operator()() const 
/home/jenkins-slave/workspace/kudu-master/0/src/kudu/master/catalog_manager.cc:5040:29
    #5 0x7f35db72e47c in 
kudu::master::CatalogManager::BuildLocationsForTablet(scoped_refptr<kudu::master::TabletInfo>
 const&, kudu::master::ReplicaTypeFilter, kudu::master::TabletLocationsPB*, 
kudu::master::CatalogManager::TSInfosDict*)::$_29::operator()() const 
/home/jenkins-slave/workspace/kudu-master/0/src/kudu/master/catalog_manager.cc:5066:30
    #6 0x7f35db72dfc2 in std::pair<google::dense_hash_map<StringPiece, int, 
GoodFastHash<StringPiece>, std::equal_to<StringPiece>, 
google::libc_allocator_with_realloc<std::pair<StringPiece const, int> > 
>::mapped_type* const, bool> 
ComputePairIfAbsentReturnAbsense<google::dense_hash_map<StringPiece, int, 
GoodFastHash<StringPiece>, std::equal_to<StringPiece>, 
google::libc_allocator_with_realloc<std::pair<StringPiece const, int> > >, 
kudu::master::CatalogManager::BuildLocationsForTablet(scoped_refptr<kudu::master::TabletInfo>
 const&, kudu::master::ReplicaTypeFilter, kudu::master::TabletLocationsPB*, 
kudu::master::CatalogManager::TSInfosDict*)::$_29>(google::dense_hash_map<StringPiece,
 int, GoodFastHash<StringPiece>, std::equal_to<StringPiece>, 
google::libc_allocator_with_realloc<std::pair<StringPiece const, int> > >*, 
google::dense_hash_map<StringPiece, int, GoodFastHash<StringPiece>, 
std::equal_to<StringPiece>, 
google::libc_allocator_with_realloc<std::pair<StringPiece const, int> > 
>::key_type const&, 
kudu::master::CatalogManager::BuildLocationsForTablet(scoped_refptr<kudu::master::TabletInfo>
 const&, kudu::master::ReplicaTypeFilter, kudu::master::TabletLocationsPB*, 
kudu::master::CatalogManager::TSInfosDict*)::$_29) 
/home/jenkins-slave/workspace/kudu-master/0/src/kudu/gutil/map-util.h:903:14
    #7 0x7f35db7178d9 in 
kudu::master::CatalogManager::BuildLocationsForTablet(scoped_refptr<kudu::master::TabletInfo>
 const&, kudu::master::ReplicaTypeFilter, kudu::master::TabletLocationsPB*, 
kudu::master::CatalogManager::TSInfosDict*) 
/home/jenkins-slave/workspace/kudu-master/0/src/kudu/master/catalog_manager.cc:5061:25
    #8 0x7f35db71939f in 
kudu::master::CatalogManager::GetTabletLocations(std::string const&, 
kudu::master::ReplicaTypeFilter, kudu::master::TabletLocationsPB*, 
kudu::master::CatalogManager::TSInfosDict*, boost::optional<std::string 
const&>) 
/home/jenkins-slave/workspace/kudu-master/0/src/kudu/master/catalog_manager.cc:5121:10
    #9 0x7f35db685fa3 in 
kudu::master::AutoRebalancerTask::GetTabletLeader(std::string const&, 
std::string*, kudu::HostPort*) const 
/home/jenkins-slave/workspace/kudu-master/0/src/kudu/master/auto_rebalancer.cc:375:5
    #10 0x7f35db686a86 in 
kudu::master::AutoRebalancerTask::CheckMoveCompleted(kudu::rebalance::Rebalancer::ReplicaMove
 const&, bool*) 
/home/jenkins-slave/workspace/kudu-master/0/src/kudu/master/auto_rebalancer.cc:679:3
    #11 0x7f35db684bce in 
kudu::master::AutoRebalancerTask::CheckReplicaMovesCompleted(std::vector<kudu::rebalance::Rebalancer::ReplicaMove,
 std::allocator<kudu::rebalance::Rebalancer::ReplicaMove> >*) 
/home/jenkins-slave/workspace/kudu-master/0/src/kudu/master/auto_rebalancer.cc:642:16
    #12 0x7f35db67de81 in kudu::master::AutoRebalancerTask::RunLoop() 
/home/jenkins-slave/workspace/kudu-master/0/src/kudu/master/auto_rebalancer.cc:247:7
    #13 0x7f35c5dacbba in kudu::Thread::SuperviseThread(void*) 
/home/jenkins-slave/workspace/kudu-master/0/src/kudu/util/thread.cc:674:3
    #14 0x7f35ce792183 in start_thread 
/build/eglibc-SvCtMH/eglibc-2.19/nptl/pthread_create.c:312


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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I65aa6b5a9854a4659d1e350e1461ad63c03d5fea
Gerrit-Change-Number: 16137
Gerrit-PatchSet: 10
Gerrit-Owner: Todd Lipcon <[email protected]>
Gerrit-Reviewer: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Andrew Wong <[email protected]>
Gerrit-Reviewer: Attila Bukor <[email protected]>
Gerrit-Reviewer: Grant Henke <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Comment-Date: Thu, 30 Jul 2020 01:36:11 +0000
Gerrit-HasComments: No

Reply via email to