@@ -350,6 +350,18 @@ class PikaConf : public pstd::BaseConf {
350350 int max_conn_rbuf_size () { return max_conn_rbuf_size_.load (); }
351351 int consensus_level () { return consensus_level_.load (); }
352352 int replication_num () { return replication_num_.load (); }
353+ int consensus_batch_size () {
354+ std::shared_lock l (rwlock_);
355+ return consensus_batch_size_;
356+ }
357+ int consensus_timeout () {
358+ std::shared_lock l (rwlock_);
359+ return consensus_timeout_;
360+ }
361+ int replication_ack_timeout () {
362+ std::shared_lock l (rwlock_);
363+ return replication_ack_timeout_;
364+ }
353365 int rate_limiter_mode () {
354366 std::shared_lock l (rwlock_);
355367 return rate_limiter_mode_;
@@ -665,6 +677,21 @@ class PikaConf : public pstd::BaseConf {
665677 TryPushDiffCommands (" max-conn-rbuf-size" , std::to_string (value));
666678 max_conn_rbuf_size_.store (value);
667679 }
680+ void SetConsensusBatchSize (const int value) {
681+ std::lock_guard l (rwlock_);
682+ TryPushDiffCommands (" consensus-batch-size" , std::to_string (value));
683+ consensus_batch_size_ = value;
684+ }
685+ void SetConsensusTimeout (const int value) {
686+ std::lock_guard l (rwlock_);
687+ TryPushDiffCommands (" consensus-timeout" , std::to_string (value));
688+ consensus_timeout_ = value;
689+ }
690+ void SetReplicationAckTimeout (const int value) {
691+ std::lock_guard l (rwlock_);
692+ TryPushDiffCommands (" replication-ack-timeout" , std::to_string (value));
693+ replication_ack_timeout_ = value;
694+ }
668695 void SetMaxCacheFiles (const int & value) {
669696 std::lock_guard l (rwlock_);
670697 TryPushDiffCommands (" max-cache-files" , std::to_string (value));
@@ -748,6 +775,12 @@ class PikaConf : public pstd::BaseConf {
748775 TryPushDiffCommands (" rsync-timeout-ms" , std::to_string (value));
749776 rsync_timeout_ms_.store (value);
750777 }
778+
779+ void SetBinlogFsyncSize (const int value) {
780+ std::lock_guard l (rwlock_);
781+ TryPushDiffCommands (" binlog-fsync-size" , std::to_string (value));
782+ binlog_fsync_size_ = value;
783+ }
751784
752785 void SetProtoMaxBulkLen (const int64_t value) {
753786 std::lock_guard l (rwlock_);
@@ -888,9 +921,6 @@ class PikaConf : public pstd::BaseConf {
888921 int ConfigRewriteSlaveOf ();
889922 int ConfigRewriteReplicationID ();
890923
891- int consensus_batch_size () const ;
892- int consensus_timeout () const ;
893-
894924 private:
895925 int port_ = 0 ;
896926 int slave_priority_ = 100 ;
@@ -982,11 +1012,14 @@ class PikaConf : public pstd::BaseConf {
9821012 int64_t rate_limiter_refill_period_us_ = 0 ;
9831013 int64_t rate_limiter_fairness_ = 0 ;
9841014 bool rate_limiter_auto_tuned_ = true ;
1015+ int replication_ack_timeout_ = 5000 ;
9851016
9861017 std::atomic<int > sync_window_size_;
9871018 std::atomic<int > max_conn_rbuf_size_;
9881019 std::atomic<int > consensus_level_;
9891020 std::atomic<int > replication_num_;
1021+ int consensus_batch_size_ = 1000 ;
1022+ int consensus_timeout_ = 1500 ;
9901023
9911024 std::string network_interface_;
9921025
@@ -1050,6 +1083,7 @@ class PikaConf : public pstd::BaseConf {
10501083 int throttle_bytes_per_second_ = 200 << 20 ; // 200MB/s
10511084 int max_rsync_parallel_num_ = kMaxRsyncParallelNum ;
10521085 std::atomic_int64_t rsync_timeout_ms_ = 1000 ;
1086+ int binlog_fsync_size_ = 8 * 1024 * 1024 ;
10531087
10541088 /*
10551089 kUninitialized = 0, // unknown setting
@@ -1068,10 +1102,6 @@ class PikaConf : public pstd::BaseConf {
10681102
10691103 // Internal used metrics Persisted by pika.conf
10701104 std::unordered_set<std::string> internal_used_unfinished_full_sync_;
1071-
1072- // Consensus configuration
1073- int consensus_batch_size_;
1074- int consensus_timeout_;
10751105};
10761106
10771107#endif
0 commit comments