Skip to content

Commit

Permalink
MacOS
Browse files Browse the repository at this point in the history
  • Loading branch information
GehaFearless committed Nov 8, 2023
1 parent 989ce80 commit 397996b
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 7 deletions.
2 changes: 0 additions & 2 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,6 @@ function run_start_onebox()
sed "s/@META_PORT@/$meta_port/;s/@REPLICA_PORT@/34800/;s/@PROMETHEUS_PORT@/$prometheus_port/" ${ROOT}/config-server.ini >config.ini
$PWD/pegasus_server config.ini -app_list meta &>result &
PID=$!
sleep 1
ps -ef | grep '/pegasus_server config.ini' | grep "\<$PID\>"
cd ..
done
Expand All @@ -862,7 +861,6 @@ function run_start_onebox()
sed "s/@META_PORT@/34600/;s/@REPLICA_PORT@/$replica_port/;s/@PROMETHEUS_PORT@/$prometheus_port/" ${ROOT}/config-server.ini >config.ini
$PWD/pegasus_server config.ini -app_list replica &>result &
PID=$!
sleep 1
ps -ef | grep '/pegasus_server config.ini' | grep "\<$PID\>"
cd ..
done
Expand Down
4 changes: 2 additions & 2 deletions src/meta/partition_guardian.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,11 @@ bool partition_guardian::from_proposals(meta_view &view,
goto invalid_action;
}
if (!is_node_alive(*(view.nodes), action.hp_target)) {
sprintf(reason, "action target(%s) is not alive", action.hp_target.to_string().c_str());
sprintf(reason, "action target(%s) is not alive", action.hp_target.get_char_ctr());
goto invalid_action;
}
if (!is_node_alive(*(view.nodes), action.hp_node)) {
sprintf(reason, "action node(%s) is not alive", action.hp_node.to_string().c_str());
sprintf(reason, "action node(%s) is not alive", action.hp_node.get_char_ctr());
goto invalid_action;
}
if (cc.lb_actions.is_abnormal_learning_proposal()) {
Expand Down
2 changes: 1 addition & 1 deletion src/meta/test/json_compacity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ void meta_service_test_app::json_compacity()
ASSERT_EQ(1, pc.hp_secondaries.size());
ASSERT_EQ(1, pc.secondaries.size());
ASSERT_STREQ("127.0.0.1:6", pc.secondaries[0].to_string());
ASSERT_STREQ("localhost:6", pc.hp_secondaries[0].to_string().c_str());
ASSERT_STREQ("localhost:6", pc.hp_secondaries[0].get_char_ctr());
ASSERT_EQ(157, pc.last_committed_decree);
ASSERT_EQ(0, pc.partition_flags);

Expand Down
2 changes: 1 addition & 1 deletion src/redis_protocol/proxy_lib/proxy_layer.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class proxy_session : public std::enable_shared_from_this<proxy_session>
virtual bool parse(dsn::message_ex *msg) = 0;
dsn::message_ex *create_response();

const char *log_prefix() const { return _remote_host_port.to_string().c_str(); }
const char *log_prefix() const { return _remote_host_port.get_char_ctr(); }

protected:
proxy_stub *_stub;
Expand Down
2 changes: 1 addition & 1 deletion src/replica/replica_stub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ void replica_stub::initialize(bool clear /* = false*/)
void replica_stub::initialize(const replication_options &opts, bool clear /* = false*/)
{
_primary_host_port = dsn_primary_host_port();
strcpy(_primary_address_str, _primary_host_port.to_string().c_str());
strcpy(_primary_address_str, _primary_host_port.get_char_ctr());
LOG_INFO("primary_address = {}", _primary_address_str);

set_options(opts);
Expand Down
6 changes: 6 additions & 0 deletions src/runtime/rpc/rpc_host_port.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ class host_port

std::string to_string() const;

// TODO(liguohao): fix this warn
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wreturn-stack-address"
const char *get_char_ctr() const { return to_string().c_str(); }
#pragma clang diagnostic pop

friend std::ostream &operator<<(std::ostream &os, const host_port &hp)
{
return os << hp.to_string();
Expand Down

0 comments on commit 397996b

Please sign in to comment.