acelyc111 commented on code in PR #2101:
URL: 
https://github.com/apache/incubator-pegasus/pull/2101#discussion_r1722980807


##########
src/server/pegasus_mutation_duplicator.cpp:
##########
@@ -245,10 +245,20 @@ void 
pegasus_mutation_duplicator::duplicate(mutation_tuple_set muts, callback cb
         dsn::blob raw_message = std::get<2>(mut);
         auto dreq = std::make_unique<dsn::apps::duplicate_request>();
 
-        if (rpc_code == dsn::apps::RPC_RRDB_RRDB_DUPLICATE) {
-            // ignore if it is a DUPLICATE
-            // Because DUPLICATE comes from other clusters should not be 
forwarded to any other
-            // destinations. A DUPLICATE is meant to be targeting only one 
cluster.
+        // ignore if it is a DUPLICATE or BULKLOAD
+        // Because DUPLICATE comes from other clusters should not be forwarded 
to any other
+        // destinations. A DUPLICATE is meant to be targeting only one cluster.
+        if (ingnored_rpc_code.find(rpc_code) != ingnored_rpc_code.end()) {

Review Comment:
   Use Contains*() in src/gutil/map_util.h to simplify the code.



##########
src/server/pegasus_mutation_duplicator.h:
##########
@@ -97,5 +98,8 @@ class pegasus_mutation_duplicator : public 
dsn::replication::mutation_duplicator
 // calculates the hash value from the write's hash key.
 extern uint64_t get_hash_from_request(dsn::task_code rpc_code, const dsn::blob 
&request_data);
 
+const std::set<int> ingnored_rpc_code = {dsn::apps::RPC_RRDB_RRDB_DUPLICATE,

Review Comment:
   Nobody else use it, you can move it to the cpp file, define it as a local 
static variable in pegasus_mutation_duplicator::duplicate().



-- 
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]

Reply via email to