You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pegasus.apache.org by "empiredan (via GitHub)" <gi...@apache.org> on 2024/11/19 09:24:23 UTC

[PR] fix(meta): meta server failed while setting environment variables to a table that has just been dropped [incubator-pegasus]

empiredan opened a new pull request, #2148:
URL: https://github.com/apache/incubator-pegasus/pull/2148

   (no comment)


-- 
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: dev-unsubscribe@pegasus.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pegasus.apache.org
For additional commands, e-mail: dev-help@pegasus.apache.org


Re: [PR] fix(meta): meta server failed and could not be started normally while setting environment variables after dropping table [incubator-pegasus]

Posted by "empiredan (via GitHub)" <gi...@apache.org>.
empiredan merged PR #2148:
URL: https://github.com/apache/incubator-pegasus/pull/2148


-- 
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: dev-unsubscribe@pegasus.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pegasus.apache.org
For additional commands, e-mail: dev-help@pegasus.apache.org


Re: [PR] fix(meta): meta server failed and could not be started normally while setting environment variables after dropping table [incubator-pegasus]

Posted by "acelyc111 (via GitHub)" <gi...@apache.org>.
acelyc111 commented on code in PR #2148:
URL: https://github.com/apache/incubator-pegasus/pull/2148#discussion_r1853371413


##########
src/meta/server_state.h:
##########
@@ -140,19 +140,26 @@ class server_state
 
     void lock_read(zauto_read_lock &other);
     void lock_write(zauto_write_lock &other);
-    const meta_view get_meta_view() { return {&_all_apps, &_nodes}; }
+
+    meta_view get_meta_view() { return {&_all_apps, &_nodes}; }
+
     std::shared_ptr<app_state> get_app(const std::string &name) const
     {
-        auto iter = _exist_apps.find(name);
-        if (iter == _exist_apps.end())
-            return nullptr;
+        const auto &iter = _exist_apps.find(name);

Review Comment:
   It would be simpler if using find* in map-utils.h



##########
src/meta/server_state.cpp:
##########
@@ -3020,31 +3024,87 @@ void server_state::set_app_envs(const app_env_rpc &env_rpc)
     app_info ainfo;
     std::string app_path;
     {
+        FAIL_POINT_INJECT_NOT_RETURN_F("set_app_envs_failed", [app_name, this](std::string_view s) {
+            zauto_write_lock l(_lock);
+
+            if (s == "not_found") {
+                CHECK_EQ(_exist_apps.erase(app_name), 1);
+                return;
+            }
+
+            if (s == "dropping") {
+                const auto &iter = _exist_apps.find(app_name);
+                CHECK_TRUE(iter != _exist_apps.end());

Review Comment:
   Use `gutil::FindOrDie()` would 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: dev-unsubscribe@pegasus.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pegasus.apache.org
For additional commands, e-mail: dev-help@pegasus.apache.org