Skip to content

Commit

Permalink
rename to send_data_to_witness
Browse files Browse the repository at this point in the history
  • Loading branch information
lintanghui committed Feb 18, 2025
1 parent 2b65ca1 commit 14b30e7
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/runtime
/output
/test/output

/bld
# Ignore hidden files
.*
*.swp
Expand Down
2 changes: 1 addition & 1 deletion src/braft/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ int NodeImpl::init(const NodeOptions& options) {
rg_options.election_timeout_ms = _options.election_timeout_ms;
rg_options.log_manager = _log_manager;
rg_options.ballot_box = _ballot_box;
rg_options.raft_enable_witness_to_leader = _options.raft_enable_witness_to_leader;
rg_options.send_data_to_witness = _options.send_data_to_witness;
rg_options.node = this;
rg_options.snapshot_throttle = _options.snapshot_throttle
? _options.snapshot_throttle->get()
Expand Down
2 changes: 1 addition & 1 deletion src/braft/raft.h
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ struct NodeOptions {
// Default: false
bool witness = false;
// Construct a default instance
bool raft_enable_witness_to_leader = true;
bool send_data_to_witness = true;
NodeOptions();

int get_catchup_timeout_ms();
Expand Down
4 changes: 2 additions & 2 deletions src/braft/replicator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ int Replicator::_prepare_entry(int offset, EntryMeta* em, butil::IOBuf *data) {
CHECK(entry->type != ENTRY_TYPE_CONFIGURATION) << "log_index=" << log_index;
}
// 优先使用group级别的配置
if (is_witness() && !_options.raft_enable_witness_to_leader) {
if (is_witness() && !_options.send_data_to_witness) {
entry->Release();
return 0;
}
Expand Down Expand Up @@ -1392,7 +1392,7 @@ int ReplicatorGroup::init(const NodeId& node_id, const ReplicatorGroupOptions& o
_election_timeout_ms = options.election_timeout_ms;
_common_options.log_manager = options.log_manager;
_common_options.ballot_box = options.ballot_box;
_common_options.raft_enable_witness_to_leader = options.raft_enable_witness_to_leader;
_common_options.send_data_to_witness = options.send_data_to_witness;
_common_options.node = options.node;
_common_options.term = 0;
_common_options.group_id = node_id.group_id;
Expand Down
4 changes: 2 additions & 2 deletions src/braft/replicator.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ struct ReplicatorOptions {
ReplicatorOptions();
int* dynamic_heartbeat_timeout_ms;
int* election_timeout_ms;
bool raft_enable_witness_to_leader;
bool send_data_to_witness;
GroupId group_id;
PeerId server_id;
PeerId peer_id;
Expand Down Expand Up @@ -268,7 +268,7 @@ struct ReplicatorGroupOptions {
ReplicatorGroupOptions();
int heartbeat_timeout_ms;
int election_timeout_ms;
bool raft_enable_witness_to_leader;
bool send_data_to_witness = true;
LogManager* log_manager;
BallotBox* ballot_box;
NodeImpl* node;
Expand Down

0 comments on commit 14b30e7

Please sign in to comment.