Skip to content

Commit

Permalink
Fixed crash on leader change (vesoft-inc#549)
Browse files Browse the repository at this point in the history
  • Loading branch information
dutor authored Jun 27, 2019
1 parent 44a6de2 commit 86eb34d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/storage/BaseProcessor.inl
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ void BaseProcessor<RESP>::doPut(GraphSpaceID spaceId,
thriftResult.set_code(to(code));
thriftResult.set_part_id(partId);
if (code == kvstore::ResultCode::ERR_LEADER_CHANGED) {
nebula::cpp2::HostAddr leader;
auto addr = kvstore_->partLeader(spaceId, partId);
thriftResult.get_leader()->set_ip(addr.first);
thriftResult.get_leader()->set_port(addr.second);
leader.set_ip(addr.first);
leader.set_port(addr.second);
thriftResult.set_leader(leader);
}
bool finished = false;
{
Expand Down

0 comments on commit 86eb34d

Please sign in to comment.