Skip to content

Commit

Permalink
Define is_proposer by comparing m_raft_server_id with rkey.server_id
Browse files Browse the repository at this point in the history
  • Loading branch information
yawzhang committed Dec 4, 2024
1 parent e03a7fd commit 76994de
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class HomestoreConan(ConanFile):
name = "homestore"
version = "6.5.20"
version = "6.5.21"

homepage = "https://github.com/eBay/Homestore"
description = "HomeStore Storage Engine"
Expand Down
2 changes: 1 addition & 1 deletion src/lib/replication/repl_dev/raft_repl_dev.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ repl_req_ptr_t RaftReplDev::applier_create_req(repl_key const& rkey, journal_typ
// We need to allocate the block, since entry doesn't exist or if it exist, two threads are trying to do the same
// thing. So take state mutex and allocate the blk
std::unique_lock< std::mutex > lg(rreq->m_state_mtx);
rreq->init(rkey, code, false /* is_proposer */, user_header, key, data_size);
rreq->init(rkey, code, m_raft_server_id == rkey.server_id, user_header, key, data_size);

// There is no data portion, so there is not need to allocate
if (!rreq->has_linked_data()) { return rreq; }
Expand Down
12 changes: 3 additions & 9 deletions src/lib/replication/repl_dev/raft_state_machine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,9 @@ repl_req_ptr_t RaftStateMachine::localize_journal_entry_finish(nuraft::log_entry

auto rreq = m_rd.repl_key_to_req(rkey);
if ((rreq == nullptr) || (rreq->is_localize_pending())) {
rreq = localize_journal_entry_prepare(lentry);
if (rreq == nullptr) {
RELEASE_ASSERT(rreq != nullptr,
"We get an linked data for rkey=[{}], jentry=[{}] not as part of Raft Append but "
"indirectly through possibly unpack() and in those cases, if we are not able to alloc "
"location to write the data, there is no recourse. So we must crash this system ",
rkey.to_string(), jentry->to_string());
return nullptr;
}
// This path is for log pack apply only.
// Now we fully disabled log pack/unpack with the new_learner opt, should not reaching here.
RELEASE_ASSERT(false, "rreq should have already localized for rkey=[{}]", rkey.to_string());
}

if (rreq->is_proposer()) {
Expand Down

0 comments on commit 76994de

Please sign in to comment.