Skip to content

Commit

Permalink
Set min_log_gap_to_join to max_int32 and enabled new_joiner_type
Browse files Browse the repository at this point in the history
Signed-off-by: Xiaoxi Chen <[email protected]>
  • Loading branch information
xiaoxichen committed Nov 13, 2024
1 parent 8452fc5 commit 0fb7a66
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 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.10"
version = "6.5.11"

homepage = "https://github.com/eBay/Homestore"
description = "HomeStore Storage Engine"
Expand Down
2 changes: 1 addition & 1 deletion src/lib/common/homestore_config.fbs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ table Consensus {
stale_log_gap_lo_threshold: int32 = 30;

// Minimum log gap a replica has to be from leader before joining the replica set.
min_log_gap_to_join: int32 = 30;
min_log_gap_to_join: int32 = 2147483647;

// amount of time in millis to wait on data write before fetch data from remote;
wait_data_write_timer_ms: uint64 = 1500 (hotswap);
Expand Down
9 changes: 4 additions & 5 deletions src/lib/replication/service/raft_repl_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,18 +99,17 @@ void RaftReplService::start() {
.with_hb_interval(HS_DYNAMIC_CONFIG(consensus.heartbeat_period_ms))
.with_max_append_size(HS_DYNAMIC_CONFIG(consensus.max_append_batch_size))
.with_log_sync_batch_size(HS_DYNAMIC_CONFIG(consensus.log_sync_batch_size))
// TODO to fix the log_gap thresholds when adding new member.
// When the option is enabled, new member is doing log sync is stuck after the first batch
// where if the option is disabled, new member is going through append entries and it works.
#if 0
.with_log_sync_stopping_gap(HS_DYNAMIC_CONFIG(consensus.min_log_gap_to_join))
#endif
.with_stale_log_gap(HS_DYNAMIC_CONFIG(consensus.stale_log_gap_hi_threshold))
.with_fresh_log_gap(HS_DYNAMIC_CONFIG(consensus.stale_log_gap_lo_threshold))
.with_snapshot_enabled(HS_DYNAMIC_CONFIG(consensus.snapshot_freq_distance))
.with_leadership_expiry(HS_DYNAMIC_CONFIG(consensus.leadership_expiry_ms))
.with_reserved_log_items(HS_DYNAMIC_CONFIG(consensus.num_reserved_log_items))
.with_auto_forwarding(false);
// new_joiner_type fully disabled log pack behavior.
// There is no callback available for handling and localizing the log entries within the pack, which could
// result in data corruption.
r_params.use_new_joiner_type_ = true;
r_params.return_method_ = nuraft::raft_params::async_handler;
m_msg_mgr->register_mgr_type(params.default_group_type_, r_params);

Expand Down

0 comments on commit 0fb7a66

Please sign in to comment.