Skip to content

Commit

Permalink
raft调用InstallSnapshot存在重复的问题 youngyangyang04#57
Browse files Browse the repository at this point in the history
  • Loading branch information
beanljun committed Jul 29, 2024
1 parent e33347a commit 3d69c57
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion src/raftCore/raft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,6 @@ void Raft::InstallSnapshot(const raftRpcProctoc::InstallSnapshotRequest* args,
msg.SnapshotTerm = args->lastsnapshotincludeterm();
msg.SnapshotIndex = args->lastsnapshotincludeindex();

applyChan->Push(msg);
std::thread t(&Raft::pushMsgToKvServer, this, msg); // 创建新线程并执行b函数,并传递参数
t.detach();
//看下这里能不能再优化
Expand Down
2 changes: 1 addition & 1 deletion src/rpc/mprpcconfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ void MprpcConfig::LoadConfigFile(const char *config_file) {
Trim(read_buf);

// 判断#的注释
if (read_buf[0] == '#' || read_buf.empty()) {
if (read_buf.empty() || read_buf[0] == '#') {
continue;
}

Expand Down

0 comments on commit 3d69c57

Please sign in to comment.