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


##########
src/rdsn/src/replica/replica.h:
##########
@@ -496,6 +496,7 @@ class replica : public serverlet<replica>, public 
ref_counter, public replica_ba
     clear_on_failure(replica_stub *stub, replica *rep, const std::string 
&path, const gpid &pid);
 
     void update_app_max_replica_count(int32_t max_replica_count);
+    void update_app_name(std::string app_name);

Review Comment:
   better to use const reference



##########
src/rdsn/src/replica/replica_config.cpp:
##########
@@ -1143,6 +1144,23 @@ void replica::on_config_sync(const app_info &info,
     }
 }
 
+void replica::update_app_name(std::string app_name)
+{
+    if (app_name == _app_info.app_name) {
+        return;
+    }
+
+    auto old_app_name = _app_info.app_name;
+    _app_info.app_name = app_name;
+
+    auto ec = store_app_info(_app_info);
+    dassert_replica(ec == ERR_OK,

Review Comment:
   use `dcheck_eq_replica` to simplify the code



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