diff --git a/run.sh b/run.sh index 7629eec9ac..d989b1dad3 100755 --- a/run.sh +++ b/run.sh @@ -465,7 +465,8 @@ function run_test() m_count=3 if [ "${module}" == "recovery_test" ]; then m_count=1 - opts="meta_state_service_type=meta_state_service_simple,distributed_lock_service_type=distributed_lock_service_simple" + fqdn=`hostname -f` + opts="server_list=$fqdn:34601,meta_state_service_type=meta_state_service_simple,distributed_lock_service_type=distributed_lock_service_simple" fi if [ "${module}" == "backup_restore_test" ]; then opts="cold_backup_disabled=false,cold_backup_checkpoint_reserve_minutes=0,cold_backup_root=onebox" @@ -485,7 +486,19 @@ function run_test() run_start_zk fi pushd ${BUILD_LATEST_DIR}/bin/${module} - sed -i "s/@LOCAL_HOSTNAME@/${LOCAL_HOSTNAME}/g" ./config.ini + local function_tests=( + backup_restore_test + recovery_test + restore_test + base_api_test + throttle_test + bulk_load_test + detect_hotspot_test + partition_split_test + ) + if [[ "${function_tests[@]}" =~ "${test_modules}" ]]; then + sed -i "s/@LOCAL_HOSTNAME@/${LOCAL_HOSTNAME}/g" ./config.ini + fi REPORT_DIR=${REPORT_DIR} TEST_BIN=${module} TEST_OPTS=${test_opts} ./run.sh if [ $? != 0 ]; then echo "run test \"$module\" in `pwd` failed" diff --git a/src/client_lib/pegasus_client_factory_impl.cpp b/src/client_lib/pegasus_client_factory_impl.cpp index a590e52553..f84d8ce0b5 100644 --- a/src/client_lib/pegasus_client_factory_impl.cpp +++ b/src/client_lib/pegasus_client_factory_impl.cpp @@ -63,11 +63,11 @@ pegasus_client *pegasus_client_factory_impl::get_client(const char *cluster_name const char *app_name) { if (cluster_name == nullptr || cluster_name[0] == '\0') { - LOG_ERROR("invalid parameter 'cluster_name'"); + LOG_ERROR("invalid parameter 'cluster_name' {}", cluster_name); return nullptr; } if (app_name == nullptr || app_name[0] == '\0') { - LOG_ERROR("invalid parameter 'app_name'"); + LOG_ERROR("invalid parameter 'app_name' {}", app_name); return nullptr; } diff --git a/src/meta/meta_service.cpp b/src/meta/meta_service.cpp index 55282ab4d0..34445adcc3 100644 --- a/src/meta/meta_service.cpp +++ b/src/meta/meta_service.cpp @@ -417,7 +417,8 @@ error_code meta_service::start() _failure_detector->acquire_leader_lock(); CHECK(_failure_detector->get_leader(nullptr), "must be primary at this point"); LOG_INFO("{}({}) got the primary lock, start to recover server state from remote storage", - dsn_primary_host_port(), dsn_primary_address()); + dsn_primary_host_port(), + dsn_primary_address()); // initialize the load balancer server_load_balancer *balancer = utils::factory_store::create( diff --git a/src/test/function_test/recovery/test_recovery.cpp b/src/test/function_test/recovery/test_recovery.cpp index b8b5ad01c6..1d95bbf4e0 100644 --- a/src/test/function_test/recovery/test_recovery.cpp +++ b/src/test/function_test/recovery/test_recovery.cpp @@ -21,6 +21,7 @@ // IWYU pragma: no_include // IWYU pragma: no_include #include +#include #include #include #include @@ -75,8 +76,9 @@ class recovery_test : public test_util std::vector result; result.reserve(ports.size()); for (const int &p : ports) { - dsn::rpc_address addr(global_env::instance()._host_ip.c_str(), p); - dsn::host_port hp(addr); + char hostname[1024]; + gethostname(hostname, 1024); + dsn::host_port hp(hostname, p); result.push_back(hp); } return result;