Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

Commit

Permalink
fix migrate pause problem
Browse files Browse the repository at this point in the history
  • Loading branch information
CatKang committed Oct 23, 2017
1 parent 32618c3 commit 638ec94
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/meta/zp_meta_info_store.cc
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ Status ZPMetaInfoStore::Refresh() {
}

LOG(INFO) << "Update node_table_ from floyd succ.";
NodesDebug();
//NodesDebug();

// Update Version
epoch_ = tmp_epoch;
Expand Down Expand Up @@ -662,8 +662,8 @@ Status ZPMetaInfoStore::GetNodeOffset(const ZPMeta::Node& node,
if (node_infos_.find(ip_port) == node_infos_.end()) {
return Status::NotFound("node not exist");
}
LOG(INFO) << "node: " << node.ip() << ":" << node.port();
node_infos_.at(ip_port).Dump();
//LOG(INFO) << "node: " << node.ip() << ":" << node.port();
//node_infos_.at(ip_port).Dump();
return node_infos_.at(ip_port).GetOffset(table, partition_id, noffset);
}

Expand Down
4 changes: 4 additions & 0 deletions src/meta/zp_meta_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,7 @@ void ZPMetaServer::ProcessMigrateIfNeed() {
}
LOG(INFO) << "Begin Process " << diffs.size() << " migrate item";

int remain_count = diffs.size();
for (const auto& diff : diffs) {
// Add Slave
s = update_thread_->PendingUpdate(
Expand All @@ -493,6 +494,7 @@ void ZPMetaServer::ProcessMigrateIfNeed() {

if (!s.ok()) {
LOG(WARNING) << "Pending migrate item failed: " << s.ToString();
migrate_register_->PutN(remain_count);
break;
}

Expand Down Expand Up @@ -522,6 +524,8 @@ void ZPMetaServer::ProcessMigrateIfNeed() {
diff.left(),
diff.right()),
updates);

remain_count--;
}
}

Expand Down

0 comments on commit 638ec94

Please sign in to comment.