empiredan commented on code in PR #2172:
URL: 
https://github.com/apache/incubator-pegasus/pull/2172#discussion_r1910122670


##########
src/client/replication_ddl_client.cpp:
##########
@@ -1477,17 +1396,22 @@ void replication_ddl_client::end_meta_request(const 
rpc_response_task_ptr &callb
 dsn::error_code replication_ddl_client::get_app_envs(const std::string 
&app_name,
                                                      std::map<std::string, 
std::string> &envs)
 {
+    // Just match the table with the provided name exactly since we want to 
get the envs from
+    // a specific table.
     std::vector<::dsn::app_info> apps;
-    auto r = list_apps(dsn::app_status::AS_AVAILABLE, apps);
-    if (r != dsn::ERR_OK) {
-        return r;
+    const auto &result = list_apps(
+        dsn::app_status::AS_AVAILABLE, app_name, 
utils::pattern_match_type::PMT_MATCH_EXACT, apps);
+    if (!result) {
+        return result.code();
     }
 
-    for (auto &app : apps) {
-        if (app.app_name == app_name) {
-            envs = app.envs;
-            return dsn::ERR_OK;
+    for (const auto &app : apps) {
+        if (app.app_name != app_name) {

Review Comment:
   Once the meta server does not support `app_name` and `match_type` (still the 
old version) for `RPC_CM_LIST_APPS`, the response would include all available 
tables. Thus here we should still check if the table name in the response is 
the target. Also add this description as comments.



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