-
Notifications
You must be signed in to change notification settings - Fork 312
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
feat: overload dump_write_request of replication_app_base.h #533
Conversation
@@ -2618,5 +2618,57 @@ void pegasus_server_impl::release_db() | |||
_db = nullptr; | |||
} | |||
|
|||
std::string pegasus_server_impl::dump_write_request(dsn::message_ex *request) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
std::string pegasus_server_impl::dump_write_request(dsn::message_ex *request) | |
static std::string dump_write_request(dsn::message_ex *request) |
I see no private member of pegasus_server_impl is used, so make it a static function.
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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("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=") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using fmtlib will make it looks simpler and more efficient.
What problem does this PR solve?
XiaoMi/rdsn#414 forbids the large write size request, but the log information is simple, XiaoMi/rdsn#458 provide the interface of
dump_write_request
, this pr overload it.Check List
Tests
max_allowed_write_size = 5
set
any key-value whose size > 5Related changes