From 6ba8e29c6020d8399f6af1cebc6ddc80a23a3f4d Mon Sep 17 00:00:00 2001 From: WeijieSun Date: Thu, 26 Apr 2018 11:49:02 +0800 Subject: [PATCH] client & server: fix as storage rpc code definition are modified in rdsn (#28) --- rdsn | 2 +- src/include/rrdb/rrdb.client.h | 4 +++- src/include/rrdb/rrdb.code.definition.h | 29 ++++++++++--------------- src/server/config-server.ini | 18 --------------- src/server/config.ini | 27 ----------------------- src/server/main.cpp | 4 ---- src/server/pegasus_counter_updater.cpp | 12 +++++----- src/shell/commands.h | 1 + 8 files changed, 23 insertions(+), 74 deletions(-) diff --git a/rdsn b/rdsn index 4da4295..655e8b7 160000 --- a/rdsn +++ b/rdsn @@ -1 +1 @@ -Subproject commit 4da42959926c43d971e6ea93f30f59b5ba02e6bb +Subproject commit 655e8b7a2b78644190ddfbe3d5961fba51177165 diff --git a/src/include/rrdb/rrdb.client.h b/src/include/rrdb/rrdb.client.h index 6837f21..a29978c 100644 --- a/src/include/rrdb/rrdb.client.h +++ b/src/include/rrdb/rrdb.client.h @@ -1,5 +1,6 @@ #pragma once #include "rrdb.code.definition.h" +#include "rrdb.types.h" #include namespace dsn { @@ -9,6 +10,7 @@ class rrdb_client : public virtual ::dsn::clientlet public: rrdb_client() {} explicit rrdb_client(::dsn::rpc_address server) { _server = server; } + virtual ~rrdb_client() {} // ---------- call RPC_RRDB_RRDB_PUT ------------ @@ -465,4 +467,4 @@ private: ::dsn::rpc_address _server; }; } -} \ No newline at end of file +} diff --git a/src/include/rrdb/rrdb.code.definition.h b/src/include/rrdb/rrdb.code.definition.h index 33b5549..b7a55bd 100644 --- a/src/include/rrdb/rrdb.code.definition.h +++ b/src/include/rrdb/rrdb.code.definition.h @@ -1,23 +1,18 @@ #pragma once -#include -#include "rrdb.types.h" +#include namespace dsn { namespace apps { -// define your own thread pool using DEFINE_THREAD_POOL_CODE(xxx) -// define RPC task code for service 'rrdb' -DEFINE_TASK_CODE_RPC(RPC_RRDB_RRDB_PUT, TASK_PRIORITY_COMMON, ::dsn::THREAD_POOL_DEFAULT) -DEFINE_TASK_CODE_RPC(RPC_RRDB_RRDB_MULTI_PUT, TASK_PRIORITY_COMMON, ::dsn::THREAD_POOL_DEFAULT) -DEFINE_TASK_CODE_RPC(RPC_RRDB_RRDB_REMOVE, TASK_PRIORITY_COMMON, ::dsn::THREAD_POOL_DEFAULT) -DEFINE_TASK_CODE_RPC(RPC_RRDB_RRDB_MULTI_REMOVE, TASK_PRIORITY_COMMON, ::dsn::THREAD_POOL_DEFAULT) -DEFINE_TASK_CODE_RPC(RPC_RRDB_RRDB_GET, TASK_PRIORITY_COMMON, ::dsn::THREAD_POOL_DEFAULT) -DEFINE_TASK_CODE_RPC(RPC_RRDB_RRDB_MULTI_GET, TASK_PRIORITY_COMMON, ::dsn::THREAD_POOL_DEFAULT) -DEFINE_TASK_CODE_RPC(RPC_RRDB_RRDB_SORTKEY_COUNT, TASK_PRIORITY_COMMON, ::dsn::THREAD_POOL_DEFAULT) -DEFINE_TASK_CODE_RPC(RPC_RRDB_RRDB_TTL, TASK_PRIORITY_COMMON, ::dsn::THREAD_POOL_DEFAULT) -DEFINE_TASK_CODE_RPC(RPC_RRDB_RRDB_GET_SCANNER, TASK_PRIORITY_COMMON, ::dsn::THREAD_POOL_DEFAULT) -DEFINE_TASK_CODE_RPC(RPC_RRDB_RRDB_SCAN, TASK_PRIORITY_COMMON, ::dsn::THREAD_POOL_DEFAULT) -DEFINE_TASK_CODE_RPC(RPC_RRDB_RRDB_CLEAR_SCANNER, TASK_PRIORITY_COMMON, ::dsn::THREAD_POOL_DEFAULT) -// test timer task code -DEFINE_TASK_CODE(LPC_RRDB_TEST_TIMER, TASK_PRIORITY_COMMON, ::dsn::THREAD_POOL_DEFAULT) +DEFINE_STORAGE_WRITE_RPC_CODE(RPC_RRDB_RRDB_PUT, true) +DEFINE_STORAGE_WRITE_RPC_CODE(RPC_RRDB_RRDB_MULTI_PUT, false) +DEFINE_STORAGE_WRITE_RPC_CODE(RPC_RRDB_RRDB_REMOVE, true) +DEFINE_STORAGE_WRITE_RPC_CODE(RPC_RRDB_RRDB_MULTI_REMOVE, false) +DEFINE_STORAGE_READ_RPC_CODE(RPC_RRDB_RRDB_GET) +DEFINE_STORAGE_READ_RPC_CODE(RPC_RRDB_RRDB_MULTI_GET) +DEFINE_STORAGE_READ_RPC_CODE(RPC_RRDB_RRDB_SORTKEY_COUNT) +DEFINE_STORAGE_READ_RPC_CODE(RPC_RRDB_RRDB_TTL) +DEFINE_STORAGE_READ_RPC_CODE(RPC_RRDB_RRDB_GET_SCANNER) +DEFINE_STORAGE_READ_RPC_CODE(RPC_RRDB_RRDB_SCAN) +DEFINE_STORAGE_READ_RPC_CODE(RPC_RRDB_RRDB_CLEAR_SCANNER) } } diff --git a/src/server/config-server.ini b/src/server/config-server.ini index 2842341..55de672 100644 --- a/src/server/config-server.ini +++ b/src/server/config-server.ini @@ -324,24 +324,6 @@ is_profile = true ;profiler::qps = false ;profiler::cancelled = false -[task.RPC_L2_CLIENT_READ] -is_profile = true -profiler::inqueue = false -;profiler::queue = false -;profiler::exec = false -;profiler::qps = false -;profiler::cancelled = false -;profiler::latency.server = false - -[task.RPC_L2_CLIENT_WRITE] -is_profile = true -profiler::inqueue = false -;profiler::queue = false -;profiler::exec = false -;profiler::qps = false -;profiler::cancelled = false -;profiler::latency.server = false - [task.LPC_AIO_BATCH_WRITE] is_profile = true profiler::inqueue = false diff --git a/src/server/config.ini b/src/server/config.ini index adb0f02..c769fb9 100644 --- a/src/server/config.ini +++ b/src/server/config.ini @@ -449,21 +449,7 @@ [task.LPC_REPLICATION_COLD_BACKUP] ;is_profile = true -[task.RPC_L2_CLIENT_WRITE] - is_profile = true - -[task.RPC_L2_CLIENT_WRITE_ACK] - is_profiler = true - -[task.RPC_L2_CLIENT_READ] - is_profile = true - -[task.RPC_L2_CLIENT_READ_ACK] - is_profiler = true - [task.RPC_RRDB_RRDB_PUT] - rpc_request_is_write_operation = true - rpc_request_is_write_allow_batch = true rpc_request_throttling_mode = TM_DELAY rpc_request_delays_milliseconds = 1000, 1000, 1000, 1000, 1000, 10000 is_profile = true @@ -472,8 +458,6 @@ is_profile = true [task.RPC_RRDB_RRDB_MULTI_PUT] - rpc_request_is_write_operation = true - rpc_request_is_write_allow_batch = false rpc_request_throttling_mode = TM_DELAY rpc_request_delays_milliseconds = 1000, 1000, 1000, 1000, 1000, 10000 is_profile = true @@ -482,8 +466,6 @@ is_profile = true [task.RPC_RRDB_RRDB_REMOVE] - rpc_request_is_write_operation = true - rpc_request_is_write_allow_batch = true rpc_request_throttling_mode = TM_DELAY rpc_request_delays_milliseconds = 1000, 1000, 1000, 1000, 1000, 10000 is_profile = true @@ -492,8 +474,6 @@ is_profile = true [task.RPC_RRDB_RRDB_MULTI_REMOVE] - rpc_request_is_write_operation = true - rpc_request_is_write_allow_batch = false rpc_request_throttling_mode = TM_DELAY rpc_request_delays_milliseconds = 1000, 1000, 1000, 1000, 1000, 10000 is_profile = true @@ -502,7 +482,6 @@ is_profile = true [task.RPC_RRDB_RRDB_GET] - rpc_request_is_write_operation = false rpc_request_throttling_mode = TM_DELAY rpc_request_delays_milliseconds = 1000, 1000, 1000, 1000, 1000, 10000 is_profile = true @@ -511,7 +490,6 @@ is_profile = true [task.RPC_RRDB_RRDB_MULTI_GET] - rpc_request_is_write_operation = false rpc_request_throttling_mode = TM_DELAY rpc_request_delays_milliseconds = 1000, 1000, 1000, 1000, 1000, 10000 is_profile = true @@ -520,7 +498,6 @@ is_profile = true [task.RPC_RRDB_RRDB_SORTKEY_COUNT] - rpc_request_is_write_operation = false rpc_request_throttling_mode = TM_DELAY rpc_request_delays_milliseconds = 1000, 1000, 1000, 1000, 1000, 10000 is_profile = true @@ -529,7 +506,6 @@ is_profile = true [task.RPC_RRDB_RRDB_TTL] - rpc_request_is_write_operation = false rpc_request_throttling_mode = TM_DELAY rpc_request_delays_milliseconds = 1000, 1000, 1000, 1000, 1000, 10000 is_profile = true @@ -538,7 +514,6 @@ is_profile = true [task.RPC_RRDB_RRDB_GET_SCANNER] - rpc_request_is_write_operation = false rpc_request_throttling_mode = TM_DELAY rpc_request_delays_milliseconds = 1000, 1000, 1000, 1000, 1000, 10000 is_profile = true @@ -547,7 +522,6 @@ is_profile = true [task.RPC_RRDB_RRDB_SCAN] - rpc_request_is_write_operation = false rpc_request_throttling_mode = TM_DELAY rpc_request_delays_milliseconds = 1000, 1000, 1000, 1000, 1000, 10000 is_profile = true @@ -556,7 +530,6 @@ is_profile = true [task.RPC_RRDB_RRDB_CLEAR_SCANNER] - rpc_request_is_write_operation = false rpc_request_throttling_mode = TM_DELAY rpc_request_delays_milliseconds = 1000, 1000, 1000, 1000, 1000, 10000 is_profile = true diff --git a/src/server/main.cpp b/src/server/main.cpp index 743adde..619fd40 100644 --- a/src/server/main.cpp +++ b/src/server/main.cpp @@ -35,10 +35,6 @@ using namespace dsn::replication; void dsn_app_registration_pegasus() { - dsn::task_code rpc_read( - "RPC_L2_CLIENT_READ", TASK_TYPE_RPC_REQUEST, TASK_PRIORITY_COMMON, THREAD_POOL_LOCAL_APP); - dsn::task_code rpc_write( - "RPC_L2_CLIENT_WRITE", TASK_TYPE_RPC_REQUEST, TASK_PRIORITY_LOW, THREAD_POOL_REPLICATION); dsn_meta_sever_register_providers(); service_app::register_factory<::pegasus::server::pegasus_replication_service_app>("replica"); diff --git a/src/server/pegasus_counter_updater.cpp b/src/server/pegasus_counter_updater.cpp index 483ce20..f814bcf 100644 --- a/src/server/pegasus_counter_updater.cpp +++ b/src/server/pegasus_counter_updater.cpp @@ -25,12 +25,12 @@ namespace server { // clang-format off static const char *s_brief_stat_mapper[] = { - "write_qps", "zion*profiler*RPC_L2_CLIENT_WRITE.qps", - "PUT_P99(ns)","zion*profiler*RPC_RRDB_RRDB_PUT.latency.server", - "MULTI_PUT_P99(ns)", "zion*profiler*RPC_RRDB_RRDB_MULTI_PUT.latency.server", - "read_qps", "zion*profiler*RPC_L2_CLIENT_READ.qps", - "GET_P99(ns)", "zion*profiler*RPC_RRDB_RRDB_GET.latency.server", - "MULTI_GET_P99(ns)", "zion*profiler*RPC_RRDB_RRDB_MULTI_GET.latency.server", + "put_qps", "zion*profiler*RPC_RRDB_RRDB_PUT.qps", + "put_p99(ns)","zion*profiler*RPC_RRDB_RRDB_PUT.latency.server", + "multi_put_p99(ns)", "zion*profiler*RPC_RRDB_RRDB_MULTI_PUT.latency.server", + "get_qps", "zion*profiler*RPC_RRDB_RRDB_GET.qps", + "get_p99(ns)", "zion*profiler*RPC_RRDB_RRDB_GET.latency.server", + "multi_get_p99(ns)", "zion*profiler*RPC_RRDB_RRDB_MULTI_GET.latency.server", "serving_replica_count", "replica*eon.replica_stub*replica(Count)", "opening_replica_count", "replica*eon.replica_stub*opening.replica(Count)", "closing_replica_count", "replica*eon.replica_stub*closing.replica(Count)", diff --git a/src/shell/commands.h b/src/shell/commands.h index c177e60..8a960eb 100644 --- a/src/shell/commands.h +++ b/src/shell/commands.h @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include -- GitLab