Skip to content

Commit

Permalink
fix repl service
Browse files Browse the repository at this point in the history
  • Loading branch information
JacksonYao287 committed Jan 31, 2024
1 parent 198657e commit d9855e4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/lib/homestore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ bool HomeStore::start(const hs_input_params& input, hs_before_services_starting_
if (has_meta_service()) { m_meta_service = std::make_unique< MetaBlkService >(); }
if (has_index_service()) { m_index_service = std::make_unique< IndexService >(std::move(s_index_cbs)); }
if (has_repl_data_service()) {
m_repl_service = GenericReplService::create(std::move(s_repl_app));
m_log_service = std::make_unique< LogStoreService >();
m_data_service = std::make_unique< BlkDataService >(std::move(s_custom_chunk_selector));
} else {
Expand Down Expand Up @@ -195,6 +194,11 @@ void HomeStore::format_and_start(std::map< uint32_t, hs_format_params >&& format
}

void HomeStore::do_start() {
// when coming here:
// 1 if this is the first_time_boot, , the repl app already gets its uuid from upper layer
// 2 if this is not the first_time_boot, the repl app already gets its uuid from the metaservice
// now , we can safely initialize GenericReplService , which will get a correct uuid through get_my_repl_uuid()
if (has_repl_data_service()) m_repl_service = GenericReplService::create(std::move(s_repl_app));
const auto& inp_params = HomeStoreStaticConfig::instance().input;

uint64_t cache_size = resource_mgr().get_cache_size();
Expand Down
4 changes: 2 additions & 2 deletions src/lib/replication/service/raft_repl_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ void RaftReplService::start() {
.token_client_ = std::dynamic_pointer_cast< sisl::GrpcTokenClient >(ioenvironment.get_token_client())};
m_msg_mgr = nuraft_mesg::init_messaging(params, weak_from_this(), true /* with_data_channel */);

LOGINFOMOD(replication, "Starting RaftReplService with server_uuid={} port={}",
boost::uuids::to_string(params.server_uuid_), params.mesg_port_);
LOGINFO("Starting RaftReplService with server_uuid={} port={}", boost::uuids::to_string(params.server_uuid_),
params.mesg_port_);

// Step 2: Register all RAFT parameters. At the end of this step, raft is ready to be created/join group
auto r_params = nuraft::raft_params()
Expand Down

0 comments on commit d9855e4

Please sign in to comment.