Smityz commented on a change in pull request #603:
URL: https://github.com/apache/incubator-pegasus/pull/603#discussion_r502171464



##########
File path: src/server/pegasus_server_impl.cpp
##########
@@ -2798,5 +2800,28 @@ void 
pegasus_server_impl::set_ingestion_status(dsn::replication::ingestion_statu
     _ingestion_status = status;
 }
 
+void pegasus_server_impl::on_detect_hotkey(const 
dsn::replication::detect_hotkey_request &req,
+                                           
dsn::replication::detect_hotkey_response &resp)
+{
+
+    if (dsn_unlikely(req.action != dsn::replication::detect_action::START &&
+                     req.action != dsn::replication::detect_action::STOP)) {
+        resp.err = dsn::ERR_OBJECT_NOT_FOUND;
+        resp.__set_err_hint("invalid detect_action");
+        return;
+    }
+
+    if (dsn_unlikely(req.type != dsn::replication::hotkey_type::READ &&
+                     req.type != dsn::replication::hotkey_type::WRITE)) {
+        resp.err = dsn::ERR_OBJECT_NOT_FOUND;
+        resp.__set_err_hint("invalid hotkey_type");
+        return;
+    }

Review comment:
       In the past codes, `replica_stub` only responsible for delivering 
messages, and the specific .cpp to validate the request.
   So I think it's ok to validate here.




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

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