Skip to content

Commit

Permalink
[fix][store] Adjust raft init election time.
Browse files Browse the repository at this point in the history
  • Loading branch information
rock-git authored and ketor committed Dec 3, 2023
1 parent ff426a1 commit 22256fc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion conf/index.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ raft:
port: $RAFT_PORT$
path: $BASE_PATH$/data/raft_data
log_path: $BASE_PATH$/data/raft_log
election_timeout_s: 6
election_timeout_s: 12
snapshot_interval_s: 120
segmentlog_max_segment_size: 33554432 # 32MB
log:
Expand Down
3 changes: 2 additions & 1 deletion src/store/region_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
#include "vector/vector_index_snapshot_manager.h"

DEFINE_int64(merge_committed_log_gap, 16, "merge commited log gap");
DEFINE_int32(init_election_timeout_ms, 1000, "init election timeout");

namespace dingodb {

Expand Down Expand Up @@ -102,7 +103,7 @@ butil::Status CreateRegionTask::CreateRegion(const pb::common::RegionDefinition&

auto config = ConfigManager::GetInstance().GetRoleConfig();
parameter.raft_path = config->GetString("raft.path");
parameter.election_timeout_ms = 200;
parameter.election_timeout_ms = FLAGS_init_election_timeout_ms;
parameter.log_max_segment_size = config->GetInt64("raft.segmentlog_max_segment_size");
parameter.log_path = config->GetString("raft.log_path");

Expand Down

0 comments on commit 22256fc

Please sign in to comment.