Alexey Serbin has uploaded this change for review. ( 
http://gerrit.cloudera.org:8080/16021


Change subject: [consensus] small cleanup on Peer::SignalRequest()
......................................................................

[consensus] small cleanup on Peer::SignalRequest()

It's possible not to hold 'peer_lock_' while scheduling calling
SendNextRequest() on the thread pool: if 'request_pending_' or 'closed_'
changes, it's handled by Peer::SendNextRequest() as necessary.  It might
be an extra wake up of a thread in Raft pool in worst the case, but it
seems better than blocking the thread running PrepareTask().  Blocking
the latter involves blocking other threads on corresponding locks
and slowing the replication of a Raft operation, where the latter leads
to lower throughput for write operations.

The motivation for this change was seeing the following in the
logs during intensive ingest workload:

  0531 13:09:40.403224 (+515724us) spinlock_profiling.cc:244] Waited 514 ms on 
lock 0xa1581150

with the stack symbolized like below:

  kudu::(anonymous namespace)::SubmitSpinLockProfileData(void const*, long)
    src/kudu/util/spinlock_profiling.cc:230
  kudu::consensus::Peer::SignalRequest(bool)
    src/kudu/gutil/spinlock.h:106
  kudu::consensus::PeerManager::SignalRequest(bool)
    src/kudu/consensus/peer_manager.cc:98
  
kudu::consensus::RaftConsensus::Replicate(scoped_refptr<kudu::consensus::ConsensusRound>
 const&)
    src/kudu/consensus/raft_consensus.cc:740 (discriminator 2)
  kudu::tablet::TransactionDriver::Prepare()
    src/kudu/tablet/transactions/transaction_driver.cc:333
  kudu::tablet::TransactionDriver::PrepareTask()
    src/kudu/tablet/transactions/transaction_driver.cc:243
  kudu::ThreadPool::DispatchThread()
    src/kudu/util/threadpool.cc:686

I also did other minor cleanup on the code around.

Change-Id: I899aec0964bc404e6df3742bd48d0d049e52d900
---
M src/kudu/consensus/consensus_peers.cc
M src/kudu/consensus/consensus_peers.h
M src/kudu/consensus/peer_manager.cc
M src/kudu/consensus/raft_consensus.cc
M src/kudu/tablet/ops/op_driver.cc
M src/kudu/tablet/ops/op_tracker.cc
6 files changed, 36 insertions(+), 37 deletions(-)



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I899aec0964bc404e6df3742bd48d0d049e52d900
Gerrit-Change-Number: 16021
Gerrit-PatchSet: 1
Gerrit-Owner: Alexey Serbin <[email protected]>

Reply via email to