Skip to content

Commit

Permalink
Rename apply_snp_resync_data to save_snp_resync_data
Browse files Browse the repository at this point in the history
- apply_snp_resync_data is similar to apply_snapshot in raft
  • Loading branch information
yuwmao committed Jan 23, 2025
1 parent e853f25 commit dbb30c0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
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 @@ -1570,7 +1570,7 @@ void RaftReplDev::create_snp_resync_data(raft_buf_ptr_t& data_out) {
std::memcpy(data_out->data_begin(), &msg, msg_size);
}

bool RaftReplDev::apply_snp_resync_data(nuraft::buffer& data) {
bool RaftReplDev::save_snp_resync_data(nuraft::buffer& data) {
auto msg = r_cast< snp_repl_dev_data* >(data.data_begin());
if (msg->magic_num != HOMESTORE_RESYNC_DATA_MAGIC ||
msg->protocol_version != HOMESTORE_RESYNC_DATA_PROTOCOL_VERSION_V1) {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/replication/repl_dev/raft_repl_dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ class RaftReplDev : public ReplDev,
void replace_member(repl_req_ptr_t rreq);
void reset_quorum_size(uint32_t commit_quorum);
void create_snp_resync_data(raft_buf_ptr_t& data_out);
bool apply_snp_resync_data(nuraft::buffer& data);
bool save_snp_resync_data(nuraft::buffer& data);
};

} // namespace homestore
4 changes: 2 additions & 2 deletions src/lib/replication/repl_dev/raft_state_machine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,9 +354,9 @@ void RaftStateMachine::save_logical_snp_obj(nuraft::snapshot& s, ulong& obj_id,
bool is_last_obj) {
if (is_hs_snp_obj(obj_id)) {
// Homestore preserved msg
if (m_rd.apply_snp_resync_data(data)) {
if (m_rd.save_snp_resync_data(data)) {
obj_id = snp_obj_id_type_app;
LOGDEBUG("apply_snp_resync_data success, next obj_id={}", obj_id);
LOGDEBUG("save_snp_resync_data success, next obj_id={}", obj_id);
}
return;
}
Expand Down

0 comments on commit dbb30c0

Please sign in to comment.