ninsmiracle commented on code in PR #1908:
URL:
https://github.com/apache/incubator-pegasus/pull/1908#discussion_r1510674594
##########
src/server/pegasus_mutation_duplicator.cpp:
##########
@@ -205,6 +230,75 @@ void
pegasus_mutation_duplicator::on_duplicate_reply(uint64_t hash,
}
}
+void
pegasus_mutation_duplicator::type_force_send_no_idempotent_if_need(duplicate_rpc
&rpc)
+{
+
+ // there maybe more than one mutation in one dup rpc
+ if (FLAGS_force_send_no_idempotent_when_duplication) {
+ for (auto entry : rpc.request().entries) {
+ if (entry.task_code == dsn::apps::RPC_RRDB_RRDB_INCR ||
+ entry.task_code == dsn::apps::RPC_RRDB_RRDB_CHECK_AND_SET ||
+ entry.task_code == dsn::apps::RPC_RRDB_RRDB_CHECK_AND_MUTATE) {
+
Review Comment:
`entry.task_code` is not a const variable. And I think using
task_code.to_string is not more efficient than `if` structure.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]