kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject [1/3] kudu git commit: Rename Remote Bootstrap to Tablet Copy (part 1)
Date Fri, 05 Aug 2016 21:58:52 GMT
Repository: kudu
Updated Branches:
  refs/heads/master c8e29959d -> a6cb942e8


http://git-wip-us.apache.org/repos/asf/kudu/blob/a6cb942e/src/kudu/tserver/remote_bootstrap_session.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/remote_bootstrap_session.cc b/src/kudu/tserver/remote_bootstrap_session.cc
index be4ae2e..61d79df 100644
--- a/src/kudu/tserver/remote_bootstrap_session.cc
+++ b/src/kudu/tserver/remote_bootstrap_session.cc
@@ -33,10 +33,10 @@
 #include "kudu/util/stopwatch.h"
 #include "kudu/util/trace.h"
 
-DEFINE_int32(remote_bootstrap_transfer_chunk_size_bytes, 4 * 1024 * 1024,
+DEFINE_int32(tablet_copy_transfer_chunk_size_bytes, 4 * 1024 * 1024,
              "Size of chunks to transfer when copying tablets between "
              "tablet servers.");
-TAG_FLAG(remote_bootstrap_transfer_chunk_size_bytes, hidden);
+TAG_FLAG(tablet_copy_transfer_chunk_size_bytes, hidden);
 
 namespace kudu {
 namespace tserver {
@@ -55,7 +55,7 @@ using tablet::TabletMetadata;
 using tablet::TabletPeer;
 using tablet::TabletSuperBlockPB;
 
-RemoteBootstrapSession::RemoteBootstrapSession(
+TabletCopySession::TabletCopySession(
     const scoped_refptr<TabletPeer>& tablet_peer, std::string session_id,
     std::string requestor_uuid, FsManager* fs_manager)
     : tablet_peer_(tablet_peer),
@@ -65,19 +65,19 @@ RemoteBootstrapSession::RemoteBootstrapSession(
       blocks_deleter_(&blocks_),
       logs_deleter_(&logs_) {}
 
-RemoteBootstrapSession::~RemoteBootstrapSession() {
+TabletCopySession::~TabletCopySession() {
   // No lock taken in the destructor, should only be 1 thread with access now.
   CHECK_OK(UnregisterAnchorIfNeededUnlocked());
 }
 
-Status RemoteBootstrapSession::Init() {
+Status TabletCopySession::Init() {
   MutexLock l(session_lock_);
   CHECK(!initted_);
 
   const string& tablet_id = tablet_peer_->tablet_id();
 
   // Prevent log GC while we grab log segments and Tablet metadata.
-  string anchor_owner_token = Substitute("RemoteBootstrap-$0", session_id_);
+  string anchor_owner_token = Substitute("TabletCopy-$0", session_id_);
   tablet_peer_->log_anchor_registry()->Register(
       MinimumOpId().index(), anchor_owner_token, &log_anchor_);
 
@@ -108,7 +108,7 @@ Status RemoteBootstrapSession::Init() {
   if (!reader) {
     tablet::TabletStatePB tablet_state = tablet_peer_->state();
     return Status::IllegalState(Substitute(
-        "Unable to initialize remote bootstrap session for tablet $0. "
+        "Unable to initialize tablet copy session for tablet $0. "
         "Log reader is not available. Tablet state: $1 ($2)",
         tablet_id, tablet::TabletStatePB_Name(tablet_state), tablet_state));
   }
@@ -125,7 +125,7 @@ Status RemoteBootstrapSession::Init() {
   if (!consensus) {
     tablet::TabletStatePB tablet_state = tablet_peer_->state();
     return Status::IllegalState(Substitute(
-        "Unable to initialize remote bootstrap session for tablet $0. "
+        "Unable to initialize tablet copy session for tablet $0. "
         "Consensus is not available. Tablet state: $1 ($2)",
         tablet_id, tablet::TabletStatePB_Name(tablet_state), tablet_state));
   }
@@ -133,25 +133,25 @@ Status RemoteBootstrapSession::Init() {
 
   // Re-anchor on the highest OpId that was in the log right before we
   // snapshotted the log segments. This helps ensure that we don't end up in a
-  // remote bootstrap loop due to a follower falling too far behind the
-  // leader's log when remote bootstrap is slow. The remote controls when
-  // this anchor is released by ending the remote bootstrap session.
+  // tablet copy loop due to a follower falling too far behind the
+  // leader's log when tablet copy is slow. The remote controls when
+  // this anchor is released by ending the tablet copy session.
   RETURN_NOT_OK(tablet_peer_->log_anchor_registry()->UpdateRegistration(
       last_logged_opid.index(), anchor_owner_token, &log_anchor_));
 
   LOG(INFO) << Substitute(
-      "T $0 P $1: Remote bootstrap: opened $2 blocks and $3 log segments",
+      "T $0 P $1: Tablet Copy: opened $2 blocks and $3 log segments",
       tablet_id, consensus->peer_uuid(), data_blocks.size(), log_segments_.size());
   initted_ = true;
   return Status::OK();
 }
 
-const std::string& RemoteBootstrapSession::tablet_id() const {
+const std::string& TabletCopySession::tablet_id() const {
   DCHECK(initted_);
   return tablet_peer_->tablet_id();
 }
 
-const std::string& RemoteBootstrapSession::requestor_uuid() const {
+const std::string& TabletCopySession::requestor_uuid() const {
   DCHECK(initted_);
   return requestor_uuid_;
 }
@@ -162,10 +162,10 @@ static int64_t DetermineReadLength(int64_t bytes_remaining, int64_t
requested_le
   static const int kOverhead = 4096;
 
   if (requested_len <= 0) {
-    requested_len = FLAGS_remote_bootstrap_transfer_chunk_size_bytes;
+    requested_len = FLAGS_tablet_copy_transfer_chunk_size_bytes;
   } else {
     requested_len = std::min<int64_t>(requested_len,
-                                      FLAGS_remote_bootstrap_transfer_chunk_size_bytes);
+                                      FLAGS_tablet_copy_transfer_chunk_size_bytes);
   }
   requested_len = std::min<int64_t>(requested_len, FLAGS_rpc_max_message_size - kOverhead);
   CHECK_GT(requested_len, 0) << "rpc_max_message_size is too low to transfer data:
"
@@ -177,10 +177,10 @@ static int64_t DetermineReadLength(int64_t bytes_remaining, int64_t
requested_le
 // length, the file itself, and the offset into the file to be read from.
 static Status GetResponseDataSize(int64_t total_size,
                                   uint64_t offset, int64_t client_maxlen,
-                                  RemoteBootstrapErrorPB::Code* error_code, int64_t* data_size)
{
+                                  TabletCopyErrorPB::Code* error_code, int64_t* data_size)
{
   // If requested offset is off the end of the data, bail.
   if (offset >= total_size) {
-    *error_code = RemoteBootstrapErrorPB::INVALID_REMOTE_BOOTSTRAP_REQUEST;
+    *error_code = TabletCopyErrorPB::INVALID_TABLET_COPY_REQUEST;
     return Status::InvalidArgument(
         Substitute("Requested offset ($0) is beyond the data size ($1)",
                    offset, total_size));
@@ -204,7 +204,7 @@ static Status ReadFileChunkToBuf(const Info* info,
                                  uint64_t offset, int64_t client_maxlen,
                                  const string& data_name,
                                  string* data, int64_t* file_size,
-                                 RemoteBootstrapErrorPB::Code* error_code) {
+                                 TabletCopyErrorPB::Code* error_code) {
   int64_t response_data_size = 0;
   RETURN_NOT_OK_PREPEND(GetResponseDataSize(info->size, offset, client_maxlen, error_code,
                                             &response_data_size),
@@ -224,7 +224,7 @@ static Status ReadFileChunkToBuf(const Info* info,
     s = s.CloneAndPrepend(
         Substitute("Unable to read existing file for $0", data_name));
     LOG(WARNING) << s.ToString();
-    *error_code = RemoteBootstrapErrorPB::IO_ERROR;
+    *error_code = TabletCopyErrorPB::IO_ERROR;
     return s;
   }
   // Figure out if Slice points to buf or if Slice points to the mmap.
@@ -233,17 +233,17 @@ static Status ReadFileChunkToBuf(const Info* info,
     memcpy(buf, slice.data(), slice.size());
   }
   chunk_timer.stop();
-  TRACE("Remote bootstrap: $0: $1 total bytes read. Total time elapsed: $2",
+  TRACE("Tablet Copy: $0: $1 total bytes read. Total time elapsed: $2",
         data_name, response_data_size, chunk_timer.elapsed().ToString());
 
   *file_size = info->size;
   return Status::OK();
 }
 
-Status RemoteBootstrapSession::GetBlockPiece(const BlockId& block_id,
+Status TabletCopySession::GetBlockPiece(const BlockId& block_id,
                                              uint64_t offset, int64_t client_maxlen,
                                              string* data, int64_t* block_file_size,
-                                             RemoteBootstrapErrorPB::Code* error_code) {
+                                             TabletCopyErrorPB::Code* error_code) {
   ImmutableReadableBlockInfo* block_info;
   RETURN_NOT_OK(FindBlock(block_id, &block_info, error_code));
 
@@ -259,10 +259,10 @@ Status RemoteBootstrapSession::GetBlockPiece(const BlockId& block_id,
   return Status::OK();
 }
 
-Status RemoteBootstrapSession::GetLogSegmentPiece(uint64_t segment_seqno,
+Status TabletCopySession::GetLogSegmentPiece(uint64_t segment_seqno,
                                                   uint64_t offset, int64_t client_maxlen,
                                                   std::string* data, int64_t* block_file_size,
-                                                  RemoteBootstrapErrorPB::Code* error_code)
{
+                                                  TabletCopyErrorPB::Code* error_code) {
   ImmutableRandomAccessFileInfo* file_info;
   RETURN_NOT_OK(FindLogSegment(segment_seqno, &file_info, error_code));
   RETURN_NOT_OK(ReadFileChunkToBuf(file_info, offset, client_maxlen,
@@ -275,7 +275,7 @@ Status RemoteBootstrapSession::GetLogSegmentPiece(uint64_t segment_seqno,
   return Status::OK();
 }
 
-bool RemoteBootstrapSession::IsBlockOpenForTests(const BlockId& block_id) const {
+bool TabletCopySession::IsBlockOpenForTests(const BlockId& block_id) const {
   MutexLock l(session_lock_);
   return ContainsKey(blocks_, block_id);
 }
@@ -300,7 +300,7 @@ static Status AddImmutableFileToMap(Collection* const cache,
   return Status::OK();
 }
 
-Status RemoteBootstrapSession::OpenBlockUnlocked(const BlockId& block_id) {
+Status TabletCopySession::OpenBlockUnlocked(const BlockId& block_id) {
   session_lock_.AssertAcquired();
 
   gscoped_ptr<ReadableBlock> block;
@@ -328,19 +328,19 @@ Status RemoteBootstrapSession::OpenBlockUnlocked(const BlockId&
block_id) {
   return s;
 }
 
-Status RemoteBootstrapSession::FindBlock(const BlockId& block_id,
+Status TabletCopySession::FindBlock(const BlockId& block_id,
                                          ImmutableReadableBlockInfo** block_info,
-                                         RemoteBootstrapErrorPB::Code* error_code) {
+                                         TabletCopyErrorPB::Code* error_code) {
   Status s;
   MutexLock l(session_lock_);
   if (!FindCopy(blocks_, block_id, block_info)) {
-    *error_code = RemoteBootstrapErrorPB::BLOCK_NOT_FOUND;
+    *error_code = TabletCopyErrorPB::BLOCK_NOT_FOUND;
     s = Status::NotFound("Block not found", block_id.ToString());
   }
   return s;
 }
 
-Status RemoteBootstrapSession::OpenLogSegmentUnlocked(uint64_t segment_seqno) {
+Status TabletCopySession::OpenLogSegmentUnlocked(uint64_t segment_seqno) {
   session_lock_.AssertAcquired();
 
   scoped_refptr<log::ReadableLogSegment> log_segment;
@@ -366,19 +366,19 @@ Status RemoteBootstrapSession::OpenLogSegmentUnlocked(uint64_t segment_seqno)
{
   return s;
 }
 
-Status RemoteBootstrapSession::FindLogSegment(uint64_t segment_seqno,
+Status TabletCopySession::FindLogSegment(uint64_t segment_seqno,
                                               ImmutableRandomAccessFileInfo** file_info,
-                                              RemoteBootstrapErrorPB::Code* error_code) {
+                                              TabletCopyErrorPB::Code* error_code) {
   MutexLock l(session_lock_);
   if (!FindCopy(logs_, segment_seqno, file_info)) {
-    *error_code = RemoteBootstrapErrorPB::WAL_SEGMENT_NOT_FOUND;
+    *error_code = TabletCopyErrorPB::WAL_SEGMENT_NOT_FOUND;
     return Status::NotFound(Substitute("Segment with sequence number $0 not found",
                                        segment_seqno));
   }
   return Status::OK();
 }
 
-Status RemoteBootstrapSession::UnregisterAnchorIfNeededUnlocked() {
+Status TabletCopySession::UnregisterAnchorIfNeededUnlocked() {
   return tablet_peer_->log_anchor_registry()->UnregisterIfAnchored(&log_anchor_);
 }
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/a6cb942e/src/kudu/tserver/remote_bootstrap_session.h
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/remote_bootstrap_session.h b/src/kudu/tserver/remote_bootstrap_session.h
index b48b99b..7eb2383 100644
--- a/src/kudu/tserver/remote_bootstrap_session.h
+++ b/src/kudu/tserver/remote_bootstrap_session.h
@@ -14,8 +14,8 @@
 // KIND, either express or implied.  See the License for the
 // specific language governing permissions and limitations
 // under the License.
-#ifndef KUDU_TSERVER_REMOTE_BOOTSTRAP_SESSION_H_
-#define KUDU_TSERVER_REMOTE_BOOTSTRAP_SESSION_H_
+#ifndef KUDU_TSERVER_TABLET_COPY_SESSION_H_
+#define KUDU_TSERVER_TABLET_COPY_SESSION_H_
 
 #include <memory>
 #include <string>
@@ -80,13 +80,13 @@ struct ImmutableReadableBlockInfo {
   }
 };
 
-// A potential Learner must establish a RemoteBootstrapSession with the leader in order
+// A potential Learner must establish a TabletCopySession with the leader in order
 // to fetch the needed superblock, blocks, and log segments.
 // This class is refcounted to make it easy to remove it from the session map
 // on expiration while it is in use by another thread.
-class RemoteBootstrapSession : public RefCountedThreadSafe<RemoteBootstrapSession>
{
+class TabletCopySession : public RefCountedThreadSafe<TabletCopySession> {
  public:
-  RemoteBootstrapSession(const scoped_refptr<tablet::TabletPeer>& tablet_peer,
+  TabletCopySession(const scoped_refptr<tablet::TabletPeer>& tablet_peer,
                          std::string session_id, std::string requestor_uuid,
                          FsManager* fs_manager);
 
@@ -113,7 +113,7 @@ class RemoteBootstrapSession : public RefCountedThreadSafe<RemoteBootstrapSessio
   Status GetBlockPiece(const BlockId& block_id,
                        uint64_t offset, int64_t client_maxlen,
                        std::string* data, int64_t* block_file_size,
-                       RemoteBootstrapErrorPB::Code* error_code);
+                       TabletCopyErrorPB::Code* error_code);
 
   // Get a piece of a log segment.
   // The behavior and params are very similar to GetBlockPiece(), but this one
@@ -121,7 +121,7 @@ class RemoteBootstrapSession : public RefCountedThreadSafe<RemoteBootstrapSessio
   Status GetLogSegmentPiece(uint64_t segment_seqno,
                             uint64_t offset, int64_t client_maxlen,
                             std::string* data, int64_t* log_file_size,
-                            RemoteBootstrapErrorPB::Code* error_code);
+                            TabletCopyErrorPB::Code* error_code);
 
   const tablet::TabletSuperBlockPB& tablet_superblock() const {
     DCHECK(initted_);
@@ -142,12 +142,12 @@ class RemoteBootstrapSession : public RefCountedThreadSafe<RemoteBootstrapSessio
   bool IsBlockOpenForTests(const BlockId& block_id) const;
 
  private:
-  friend class RefCountedThreadSafe<RemoteBootstrapSession>;
+  friend class RefCountedThreadSafe<TabletCopySession>;
 
   typedef std::unordered_map<BlockId, ImmutableReadableBlockInfo*, BlockIdHash> BlockMap;
   typedef std::unordered_map<uint64_t, ImmutableRandomAccessFileInfo*> LogMap;
 
-  ~RemoteBootstrapSession();
+  ~TabletCopySession();
 
   // Open the block and add it to the block map.
   Status OpenBlockUnlocked(const BlockId& block_id);
@@ -155,7 +155,7 @@ class RemoteBootstrapSession : public RefCountedThreadSafe<RemoteBootstrapSessio
   // Look up cached block information.
   Status FindBlock(const BlockId& block_id,
                    ImmutableReadableBlockInfo** block_info,
-                   RemoteBootstrapErrorPB::Code* error_code);
+                   TabletCopyErrorPB::Code* error_code);
 
   // Snapshot the log segment's length and put it into segment map.
   Status OpenLogSegmentUnlocked(uint64_t segment_seqno);
@@ -163,7 +163,7 @@ class RemoteBootstrapSession : public RefCountedThreadSafe<RemoteBootstrapSessio
   // Look up log segment in cache or log segment map.
   Status FindLogSegment(uint64_t segment_seqno,
                         ImmutableRandomAccessFileInfo** file_info,
-                        RemoteBootstrapErrorPB::Code* error_code);
+                        TabletCopyErrorPB::Code* error_code);
 
   // Unregister log anchor, if it's registered.
   Status UnregisterAnchorIfNeededUnlocked();
@@ -190,10 +190,10 @@ class RemoteBootstrapSession : public RefCountedThreadSafe<RemoteBootstrapSessio
 
   log::LogAnchor log_anchor_;
 
-  DISALLOW_COPY_AND_ASSIGN(RemoteBootstrapSession);
+  DISALLOW_COPY_AND_ASSIGN(TabletCopySession);
 };
 
 } // namespace tserver
 } // namespace kudu
 
-#endif // KUDU_TSERVER_REMOTE_BOOTSTRAP_SESSION_H_
+#endif // KUDU_TSERVER_TABLET_COPY_SESSION_H_

http://git-wip-us.apache.org/repos/asf/kudu/blob/a6cb942e/src/kudu/tserver/tablet_peer_lookup.h
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/tablet_peer_lookup.h b/src/kudu/tserver/tablet_peer_lookup.h
index c58b79d..abc7861 100644
--- a/src/kudu/tserver/tablet_peer_lookup.h
+++ b/src/kudu/tserver/tablet_peer_lookup.h
@@ -31,7 +31,7 @@ class HostPort;
 class NodeInstancePB;
 
 namespace consensus {
-class StartRemoteBootstrapRequestPB;
+class StartTabletCopyRequestPB;
 } // namespace consensus
 
 namespace tablet {
@@ -51,7 +51,7 @@ class TabletPeerLookupIf {
 
   virtual const NodeInstancePB& NodeInstance() const = 0;
 
-  virtual Status StartRemoteBootstrap(const consensus::StartRemoteBootstrapRequestPB&
req,
+  virtual Status StartTabletCopy(const consensus::StartTabletCopyRequestPB& req,
                                       boost::optional<TabletServerErrorPB::Code>* error_code)
= 0;
 };
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/a6cb942e/src/kudu/tserver/tablet_server.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/tablet_server.cc b/src/kudu/tserver/tablet_server.cc
index d933491..14f2049 100644
--- a/src/kudu/tserver/tablet_server.cc
+++ b/src/kudu/tserver/tablet_server.cc
@@ -114,13 +114,13 @@ Status TabletServer::Start() {
   gscoped_ptr<ServiceIf> consensus_service(new ConsensusServiceImpl(metric_entity(),
                                                                     result_tracker(),
                                                                     tablet_manager_.get()));
-  gscoped_ptr<ServiceIf> remote_bootstrap_service(new RemoteBootstrapServiceImpl(
+  gscoped_ptr<ServiceIf> tablet_copy_service(new TabletCopyServiceImpl(
       fs_manager_.get(), tablet_manager_.get(), metric_entity(), result_tracker()));
 
   RETURN_NOT_OK(ServerBase::RegisterService(std::move(ts_service)));
   RETURN_NOT_OK(ServerBase::RegisterService(std::move(admin_service)));
   RETURN_NOT_OK(ServerBase::RegisterService(std::move(consensus_service)));
-  RETURN_NOT_OK(ServerBase::RegisterService(std::move(remote_bootstrap_service)));
+  RETURN_NOT_OK(ServerBase::RegisterService(std::move(tablet_copy_service)));
   RETURN_NOT_OK(ServerBase::Start());
 
   RETURN_NOT_OK(heartbeater_->Start());

http://git-wip-us.apache.org/repos/asf/kudu/blob/a6cb942e/src/kudu/tserver/tablet_service.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/tablet_service.cc b/src/kudu/tserver/tablet_service.cc
index f3f6db0..8ae9424 100644
--- a/src/kudu/tserver/tablet_service.cc
+++ b/src/kudu/tserver/tablet_service.cc
@@ -108,8 +108,8 @@ using consensus::LeaderStepDownRequestPB;
 using consensus::LeaderStepDownResponsePB;
 using consensus::RunLeaderElectionRequestPB;
 using consensus::RunLeaderElectionResponsePB;
-using consensus::StartRemoteBootstrapRequestPB;
-using consensus::StartRemoteBootstrapResponsePB;
+using consensus::StartTabletCopyRequestPB;
+using consensus::StartTabletCopyResponsePB;
 using consensus::VoteRequestPB;
 using consensus::VoteResponsePB;
 
@@ -980,14 +980,14 @@ void ConsensusServiceImpl::GetConsensusState(const consensus::GetConsensusStateR
   context->RespondSuccess();
 }
 
-void ConsensusServiceImpl::StartRemoteBootstrap(const StartRemoteBootstrapRequestPB* req,
-                                                StartRemoteBootstrapResponsePB* resp,
+void ConsensusServiceImpl::StartTabletCopy(const StartTabletCopyRequestPB* req,
+                                                StartTabletCopyResponsePB* resp,
                                                 rpc::RpcContext* context) {
-  if (!CheckUuidMatchOrRespond(tablet_manager_, "StartRemoteBootstrap", req, resp, context))
{
+  if (!CheckUuidMatchOrRespond(tablet_manager_, "StartTabletCopy", req, resp, context)) {
     return;
   }
   boost::optional<TabletServerErrorPB::Code> error_code;
-  Status s = tablet_manager_->StartRemoteBootstrap(*req, &error_code);
+  Status s = tablet_manager_->StartTabletCopy(*req, &error_code);
   if (!s.ok()) {
     SetupErrorAndRespond(resp->mutable_error(), s,
                          error_code.get_value_or(TabletServerErrorPB::UNKNOWN_ERROR),

http://git-wip-us.apache.org/repos/asf/kudu/blob/a6cb942e/src/kudu/tserver/tablet_service.h
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/tablet_service.h b/src/kudu/tserver/tablet_service.h
index 7147d72..430fb13 100644
--- a/src/kudu/tserver/tablet_service.h
+++ b/src/kudu/tserver/tablet_service.h
@@ -159,8 +159,8 @@ class ConsensusServiceImpl : public consensus::ConsensusServiceIf {
                                  consensus::GetConsensusStateResponsePB *resp,
                                  rpc::RpcContext *context) OVERRIDE;
 
-  virtual void StartRemoteBootstrap(const consensus::StartRemoteBootstrapRequestPB* req,
-                                    consensus::StartRemoteBootstrapResponsePB* resp,
+  virtual void StartTabletCopy(const consensus::StartTabletCopyRequestPB* req,
+                                    consensus::StartTabletCopyResponsePB* resp,
                                     rpc::RpcContext* context) OVERRIDE;
 
  private:

http://git-wip-us.apache.org/repos/asf/kudu/blob/a6cb942e/src/kudu/tserver/ts_tablet_manager.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/ts_tablet_manager.cc b/src/kudu/tserver/ts_tablet_manager.cc
index 729498e..402f6cb 100644
--- a/src/kudu/tserver/ts_tablet_manager.cc
+++ b/src/kudu/tserver/ts_tablet_manager.cc
@@ -91,7 +91,7 @@ TAG_FLAG(fault_crash_after_cmeta_deleted, unsafe);
 
 DEFINE_double(fault_crash_after_rb_files_fetched, 0.0,
               "Fraction of the time when the tablet will crash immediately "
-              "after fetching the files during a remote bootstrap but before "
+              "after fetching the files during a tablet copy but before "
               "marking the superblock as TABLET_DATA_READY. "
               "(For testing only!)");
 TAG_FLAG(fault_crash_after_rb_files_fetched, unsafe);
@@ -125,7 +125,7 @@ using consensus::ConsensusStatePB;
 using consensus::OpId;
 using consensus::RaftConfigPB;
 using consensus::RaftPeerPB;
-using consensus::StartRemoteBootstrapRequestPB;
+using consensus::StartTabletCopyRequestPB;
 using log::Log;
 using master::ReportedTabletPB;
 using master::TabletReportPB;
@@ -144,7 +144,7 @@ using tablet::TabletMetadata;
 using tablet::TabletPeer;
 using tablet::TabletStatusListener;
 using tablet::TabletStatusPB;
-using tserver::RemoteBootstrapClient;
+using tserver::TabletCopyClient;
 
 TSTabletManager::TSTabletManager(FsManager* fs_manager,
                                  TabletServer* server,
@@ -325,17 +325,17 @@ Status TSTabletManager::CheckLeaderTermNotLower(const string& tablet_id,
     Status s = Status::InvalidArgument(
         Substitute("Leader has replica of tablet $0 with term $1 "
                     "lower than last logged term $2 on local replica. Rejecting "
-                    "remote bootstrap request",
+                    "tablet copy request",
                     tablet_id,
                     leader_term, last_logged_term));
-    LOG(WARNING) << LogPrefix(tablet_id) << "Remote bootstrap: " << s.ToString();
+    LOG(WARNING) << LogPrefix(tablet_id) << "Tablet Copy: " << s.ToString();
     return s;
   }
   return Status::OK();
 }
 
-Status TSTabletManager::StartRemoteBootstrap(
-    const StartRemoteBootstrapRequestPB& req,
+Status TSTabletManager::StartTabletCopy(
+    const StartTabletCopyRequestPB& req,
     boost::optional<TabletServerErrorPB::Code>* error_code) {
   const string& tablet_id = req.tablet_id();
   const string& bootstrap_source_uuid = req.bootstrap_peer_uuid();
@@ -355,7 +355,7 @@ Status TSTabletManager::StartRemoteBootstrap(
       meta = old_tablet_peer->tablet_metadata();
       replacing_tablet = true;
     }
-    Status ret = StartTabletStateTransitionUnlocked(tablet_id, "remote bootstrapping tablet",
+    Status ret = StartTabletStateTransitionUnlocked(tablet_id, "tablet copyping tablet",
                                                     &deleter);
     if (!ret.ok()) {
       *error_code = TabletServerErrorPB::ALREADY_INPROGRESS;
@@ -369,8 +369,8 @@ Status TSTabletManager::StartRemoteBootstrap(
     switch (data_state) {
       case TABLET_DATA_COPYING:
         // This should not be possible due to the transition_in_progress_ "lock".
-        LOG(FATAL) << LogPrefix(tablet_id) << " Remote bootstrap: "
-                   << "Found tablet in TABLET_DATA_COPYING state during StartRemoteBootstrap()";
+        LOG(FATAL) << LogPrefix(tablet_id) << " Tablet Copy: "
+                   << "Found tablet in TABLET_DATA_COPYING state during StartTabletCopy()";
       case TABLET_DATA_TOMBSTONED: {
         int64_t last_logged_term = meta->tombstone_last_logged_opid().term();
         RETURN_NOT_OK(CheckLeaderTermNotLower(tablet_id, leader_term, last_logged_term));
@@ -393,7 +393,7 @@ Status TSTabletManager::StartRemoteBootstrap(
         // in flight and it may be possible for the same check in the remote
         // bootstrap client Start() method to fail. This will leave the replica in
         // a tombstoned state, and then the leader with the latest log entries
-        // will simply remote bootstrap this replica again. We could try to
+        // will simply tablet copy this replica again. We could try to
         // check again after calling Shutdown(), and if the check fails, try to
         // reopen the tablet. For now, we live with the (unlikely) race.
         RETURN_NOT_OK_PREPEND(DeleteTabletData(meta, TABLET_DATA_TOMBSTONED, last_logged_opid),
@@ -403,19 +403,19 @@ Status TSTabletManager::StartRemoteBootstrap(
       }
       default:
         return Status::IllegalState(
-            Substitute("Found tablet in unsupported state for remote bootstrap. "
+            Substitute("Found tablet in unsupported state for tablet copy. "
                         "Tablet: $0, tablet data state: $1",
                         tablet_id, TabletDataState_Name(data_state)));
     }
   }
 
-  string init_msg = kLogPrefix + Substitute("Initiating remote bootstrap from Peer $0 ($1)",
+  string init_msg = kLogPrefix + Substitute("Initiating tablet copy from Peer $0 ($1)",
                                             bootstrap_source_uuid,
                                             bootstrap_source_addr.ToString());
   LOG(INFO) << init_msg;
   TRACE(init_msg);
 
-  RemoteBootstrapClient rb_client(tablet_id, fs_manager_, server_->messenger());
+  TabletCopyClient rb_client(tablet_id, fs_manager_, server_->messenger());
 
   // Download and persist the remote superblock in TABLET_DATA_COPYING state.
   if (replacing_tablet) {
@@ -434,14 +434,14 @@ Status TSTabletManager::StartRemoteBootstrap(
 
   // Download all of the remote files.
   TOMBSTONE_NOT_OK(rb_client.FetchAll(tablet_peer->status_listener()), meta,
-                   "Remote bootstrap: Unable to fetch data from remote peer " +
+                   "Tablet Copy: Unable to fetch data from remote peer " +
                    bootstrap_source_uuid + " (" + bootstrap_source_addr.ToString() + ")");
 
   MAYBE_FAULT(FLAGS_fault_crash_after_rb_files_fetched);
 
   // Write out the last files to make the new replica visible and update the
   // TabletDataState in the superblock to TABLET_DATA_READY.
-  TOMBSTONE_NOT_OK(rb_client.Finish(), meta, "Remote bootstrap: Failure calling Finish()");
+  TOMBSTONE_NOT_OK(rb_client.Finish(), meta, "Tablet Copy: Failure calling Finish()");
 
   // We run this asynchronously. We don't tombstone the tablet if this fails,
   // because if we were to fail to open the tablet, on next startup, it's in a
@@ -580,12 +580,12 @@ Status TSTabletManager::StartTabletStateTransitionUnlocked(
     // replica of every tablet with the TABLET_DATA_DELETED parameter, which
     // indicates a "permanent" tablet deletion. If a follower services
     // DeleteTablet() before the leader does, it's possible for the leader to
-    // react to the missing replica by asking the follower to remote bootstrap
+    // react to the missing replica by asking the follower to tablet copy
     // itself.
     //
     // If the tablet was permanently deleted, we should not allow it to
     // transition back to "liveness" because that can result in flapping back
-    // and forth between deletion and remote bootstrapping.
+    // and forth between deletion and tablet copyping.
     return Status::IllegalState(
         Substitute("Tablet $0 was permanently deleted. Cannot transition from state $1.",
                    tablet_id, TabletDataState_Name(TABLET_DATA_DELETED)));
@@ -634,7 +634,7 @@ void TSTabletManager::OpenTablet(const scoped_refptr<TabletMetadata>&
meta,
   LOG_TIMING_PREFIX(INFO, LogPrefix(tablet_id), "bootstrapping tablet") {
     // Disable tracing for the bootstrap, since this would result in
     // potentially millions of transaction traces being attached to the
-    // RemoteBootstrap trace.
+    // TabletCopy trace.
     ADOPT_TRACE(nullptr);
     // TODO: handle crash mid-creation of tablet? do we ever end up with a
     // partially created tablet here?
@@ -945,12 +945,12 @@ void TSTabletManager::LogAndTombstone(const scoped_refptr<TabletMetadata>&
meta,
   const string kLogPrefix = "T " + tablet_id + " P " + fs_manager_->uuid() + ": ";
   LOG(WARNING) << kLogPrefix << msg << ": " << s.ToString();
 
-  // Tombstone the tablet when remote bootstrap fails.
-  LOG(INFO) << kLogPrefix << "Tombstoning tablet after failed remote bootstrap";
+  // Tombstone the tablet when tablet copy fails.
+  LOG(INFO) << kLogPrefix << "Tombstoning tablet after failed tablet copy";
   Status delete_status = DeleteTabletData(meta, TABLET_DATA_TOMBSTONED, boost::optional<OpId>());
   if (PREDICT_FALSE(!delete_status.ok())) {
     // This failure should only either indicate a bug or an IO error.
-    LOG(FATAL) << kLogPrefix << "Failed to tombstone tablet after remote bootstrap:
"
+    LOG(FATAL) << kLogPrefix << "Failed to tombstone tablet after tablet copy:
"
                << delete_status.ToString();
   }
 }

http://git-wip-us.apache.org/repos/asf/kudu/blob/a6cb942e/src/kudu/tserver/ts_tablet_manager.h
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/ts_tablet_manager.h b/src/kudu/tserver/ts_tablet_manager.h
index 347ab5d..8005683 100644
--- a/src/kudu/tserver/ts_tablet_manager.h
+++ b/src/kudu/tserver/ts_tablet_manager.h
@@ -144,12 +144,12 @@ class TSTabletManager : public tserver::TabletPeerLookupIf {
 
   virtual const NodeInstancePB& NodeInstance() const OVERRIDE;
 
-  // Initiate remote bootstrap of the specified tablet.
-  // See the StartRemoteBootstrap() RPC declaration in consensus.proto for details.
+  // Initiate tablet copy of the specified tablet.
+  // See the StartTabletCopy() RPC declaration in consensus.proto for details.
   // Currently this runs the entire procedure synchronously.
   // TODO: KUDU-921: Run this procedure on a background thread.
-  virtual Status StartRemoteBootstrap(
-      const consensus::StartRemoteBootstrapRequestPB& req,
+  virtual Status StartTabletCopy(
+      const consensus::StartTabletCopyRequestPB& req,
       boost::optional<TabletServerErrorPB::Code>* error_code) OVERRIDE;
 
   // Adds updated tablet information to 'report'.
@@ -259,7 +259,7 @@ class TSTabletManager : public tserver::TabletPeerLookupIf {
                           const boost::optional<consensus::OpId>& last_logged_opid);
 
   // Return Status::IllegalState if leader_term < last_logged_term.
-  // Helper function for use with remote bootstrap.
+  // Helper function for use with tablet copy.
   Status CheckLeaderTermNotLower(const std::string& tablet_id,
                                  int64_t leader_term,
                                  int64_t last_logged_term);

http://git-wip-us.apache.org/repos/asf/kudu/blob/a6cb942e/src/kudu/tserver/tserver.proto
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/tserver.proto b/src/kudu/tserver/tserver.proto
index 5964817..ffafade 100644
--- a/src/kudu/tserver/tserver.proto
+++ b/src/kudu/tserver/tserver.proto
@@ -86,7 +86,7 @@ message TabletServerErrorPB {
     // The compare-and-swap specified by an atomic RPC operation failed.
     CAS_FAILED = 17;
 
-    // The requested operation is already inprogress, e.g. RemoteBootstrap.
+    // The requested operation is already inprogress, e.g. TabletCopy.
     ALREADY_INPROGRESS = 18;
 
     // The request is throttled.


Mime
View raw message