Skip to content

Commit

Permalink
fix: overload dump_write_request shouldn't auto-reply to client (#718)
Browse files Browse the repository at this point in the history
  • Loading branch information
foreverneverer authored Apr 13, 2021
1 parent 62e4b1f commit 232a2b7
Showing 1 changed file with 18 additions and 32 deletions.
50 changes: 18 additions & 32 deletions src/server/pegasus_server_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2846,49 +2846,35 @@ std::string pegasus_server_impl::dump_write_request(dsn::message_ex *request)
{
dsn::task_code rpc_code(request->rpc_code());
if (rpc_code == dsn::apps::RPC_RRDB_RRDB_PUT) {
auto put = put_rpc::auto_reply(request).request();
auto put = put_rpc(request).request();
::dsn::blob hash_key, sort_key;
pegasus_restore_key(put.key, hash_key, sort_key);
std::string request("put:");
request.append("hash_key=")
.append(pegasus::utils::c_escape_string(hash_key))
.append(",sort_key=")
.append(pegasus::utils::c_escape_string(sort_key));
return request;
return fmt::format("put: hash_key={}, sort_key={}",
pegasus::utils::c_escape_string(hash_key),
pegasus::utils::c_escape_string(sort_key));
}

if (rpc_code == dsn::apps::RPC_RRDB_RRDB_MULTI_PUT) {
auto multi_put = multi_put_rpc::auto_reply(request).request();
std::string request("multi_put:");
request.append("hash_key=")
.append(pegasus::utils::c_escape_string((multi_put.hash_key))
.append(",multi_put_count=")
.append(std::to_string(multi_put.kvs.size())));
return request;
auto multi_put = multi_put_rpc(request).request();
return fmt::format("multi_put: hash_key={}, multi_put_count={}",
pegasus::utils::c_escape_string(multi_put.hash_key),
multi_put.kvs.size());
}

if (rpc_code == dsn::apps::RPC_RRDB_RRDB_CHECK_AND_SET) {
auto check_and_set = check_and_set_rpc::auto_reply(request).request();
std::string request("check_and_set:");
request.append("hash_key=")
.append(pegasus::utils::c_escape_string(check_and_set.hash_key))
.append(",check_sort_key=")
.append(pegasus::utils::c_escape_string(check_and_set.check_sort_key))
.append(",set_sort_key=")
.append(pegasus::utils::c_escape_string(check_and_set.set_sort_key));
return request;
auto check_and_set = check_and_set_rpc(request).request();
return fmt::format("check_and_set: hash_key={}, check_sort_key={}, set_sort_key={}",
pegasus::utils::c_escape_string(check_and_set.hash_key),
pegasus::utils::c_escape_string(check_and_set.check_sort_key),
pegasus::utils::c_escape_string(check_and_set.set_sort_key));
}

if (rpc_code == dsn::apps::RPC_RRDB_RRDB_CHECK_AND_MUTATE) {
auto check_and_mutate = check_and_mutate_rpc::auto_reply(request).request();
std::string request("check_and_mutate:");
request.append("hash_key=")
.append(pegasus::utils::c_escape_string(check_and_mutate.hash_key))
.append(",check_sort_key=")
.append(pegasus::utils::c_escape_string(check_and_mutate.check_sort_key))
.append(",set_value_count=")
.append(std::to_string(check_and_mutate.mutate_list.size()));
return request;
auto check_and_mutate = check_and_mutate_rpc(request).request();
return fmt::format("check_and_mutate: hash_key={}, check_sort_key={}, set_value_count={}",
pegasus::utils::c_escape_string(check_and_mutate.hash_key),
pegasus::utils::c_escape_string(check_and_mutate.check_sort_key),
check_and_mutate.mutate_list.size());
}

return "default";
Expand Down

0 comments on commit 232a2b7

Please sign in to comment.