Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: overload dump_write_request shouldn't auto-reply to client #718

Merged
merged 5 commits into from
Apr 13, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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