Skip to content

Commit 321dbdb

Browse files
authored
Update how to send checkpoint files.
1 parent 441462a commit 321dbdb

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

log/checkpoint_sender.cc

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,12 @@ bool CheckpointSender::SendFile(uint64_t instance_id, int machine_id,
112112
Content content;
113113
content.set_type(CHECKPOINT_MESSAGE);
114114
content.set_group_id(config_->GetGroupId());
115+
CheckpointMessage* msg = content.mutable_checkpoint_msg();
116+
msg->set_type(CHECKPOINT_FILE);
117+
msg->set_node_id(config_->GetNodeId());
118+
msg->set_instance_id(instance_id);
119+
msg->set_machine_id(machine_id);
120+
msg->set_file(file);
115121

116122
while (res) {
117123
Slice fragmenet;
@@ -126,14 +132,7 @@ bool CheckpointSender::SendFile(uint64_t instance_id, int machine_id,
126132
}
127133

128134
offset += fragmenet.size();
129-
130-
CheckpointMessage* msg = content.mutable_checkpoint_msg();
131-
msg->set_type(CHECKPOINT_FILE);
132-
msg->set_node_id(config_->GetNodeId());
133-
msg->set_instance_id(instance_id);
134135
msg->set_sequence_id(sequence_id_++);
135-
msg->set_machine_id(machine_id);
136-
msg->set_file(file);
137136
msg->set_offset(offset);
138137
msg->set_data(fragmenet.data(), fragmenet.size());
139138
config_->GetMessager()->SendMessage(receiver_node_id_, content);

0 commit comments

Comments
 (0)