From 00fb1f56a988962d0e8122dc55264777dcfd08db Mon Sep 17 00:00:00 2001 From: zhangyifan27 Date: Thu, 18 Feb 2021 10:40:03 +0800 Subject: [PATCH] fix --- include/dsn/dist/failure_detector_multimaster.h | 12 ++++++------ src/replica/mutation_log.h | 2 +- src/replica/replica_stub.cpp | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/dsn/dist/failure_detector_multimaster.h b/include/dsn/dist/failure_detector_multimaster.h index 7b7351b21b..1259eac541 100644 --- a/include/dsn/dist/failure_detector_multimaster.h +++ b/include/dsn/dist/failure_detector_multimaster.h @@ -49,20 +49,20 @@ class slave_failure_detector_with_multimaster : public dsn::fd::failure_detector slave_failure_detector_with_multimaster(std::vector<::dsn::rpc_address> &meta_servers, std::function &&master_disconnected_callback, std::function &&master_connected_callback); - virtual ~slave_failure_detector_with_multimaster() {} + virtual ~slave_failure_detector_with_multimaster() override {} - virtual void end_ping(::dsn::error_code err, const fd::beacon_ack &ack, void *context); + virtual void end_ping(::dsn::error_code err, const fd::beacon_ack &ack, void *context) override; // client side - virtual void on_master_disconnected(const std::vector<::dsn::rpc_address> &nodes); - virtual void on_master_connected(::dsn::rpc_address node); + virtual void on_master_disconnected(const std::vector<::dsn::rpc_address> &nodes) override; + virtual void on_master_connected(::dsn::rpc_address node) override; // server side - virtual void on_worker_disconnected(const std::vector<::dsn::rpc_address> &nodes) + virtual void on_worker_disconnected(const std::vector<::dsn::rpc_address> &nodes) override { dassert(false, "invalid execution flow"); } - virtual void on_worker_connected(::dsn::rpc_address node) + virtual void on_worker_connected(::dsn::rpc_address node) override { dassert(false, "invalid execution flow"); } diff --git a/src/replica/mutation_log.h b/src/replica/mutation_log.h index cd077d57fa..e1efbb2b15 100644 --- a/src/replica/mutation_log.h +++ b/src/replica/mutation_log.h @@ -99,7 +99,7 @@ class mutation_log : public ref_counter // mutation_log(const std::string &dir, int32_t max_log_file_mb, gpid gpid, replica *r = nullptr); - virtual ~mutation_log() { close(); } + virtual ~mutation_log() = default; // // initialization diff --git a/src/replica/replica_stub.cpp b/src/replica/replica_stub.cpp index d8c50d0dcc..3f2966aa3c 100644 --- a/src/replica/replica_stub.cpp +++ b/src/replica/replica_stub.cpp @@ -766,10 +766,10 @@ void replica_stub::initialize_start() // init liveness monitor dassert(NS_Disconnected == _state, ""); if (_options.fd_disabled == false) { - _failure_detector.reset(new dsn::dist::slave_failure_detector_with_multimaster( + _failure_detector = std::make_shared( _options.meta_servers, [this]() { this->on_meta_server_disconnected(); }, - [this]() { this->on_meta_server_connected(); })); + [this]() { this->on_meta_server_connected(); }); auto err = _failure_detector->start(_options.fd_check_interval_seconds, _options.fd_beacon_interval_seconds,