You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zookeeper.apache.org by ph...@apache.org on 2018/07/19 17:28:44 UTC

zookeeper git commit: ZOOKEEPER-3093: sync zerror with ZOO_ERRORS

Repository: zookeeper
Updated Branches:
  refs/heads/master fc9c9fc3b -> 4c12f75a9


ZOOKEEPER-3093: sync zerror with ZOO_ERRORS

I noticed that zerror(ZNOWATCHER) returns "unknown error" and when I went to investigate why I realized that actually three new values were added to ZOO_ERRORS enum without corresponding cases in zerror.  While here, also take the opportunity to shuffle the ordering of cases in zerror to match ZOO_ERRORS in order to make it easier to visually compare the two in the future to see if any values are missing cases (e.g. the fact that ZNEWCONFIGNOQUORUM and ZRECONFIGINPROGRESS were added to the bottom of the switch made it harder to see which all cases were missing).

Author: Kent R. Spillner <ks...@acm.org>

Reviewers: phunt@apache.org

Closes #575 from sl4mmy/zookeeper-3093

Change-Id: I52eaaad1487aa25c2ffd101d4e8f7a365e59a3ae


Project: http://git-wip-us.apache.org/repos/asf/zookeeper/repo
Commit: http://git-wip-us.apache.org/repos/asf/zookeeper/commit/4c12f75a
Tree: http://git-wip-us.apache.org/repos/asf/zookeeper/tree/4c12f75a
Diff: http://git-wip-us.apache.org/repos/asf/zookeeper/diff/4c12f75a

Branch: refs/heads/master
Commit: 4c12f75a9dd546032eafb2d2840061399c2a6a5e
Parents: fc9c9fc
Author: Kent R. Spillner <ks...@acm.org>
Authored: Thu Jul 19 10:28:38 2018 -0700
Committer: Patrick Hunt <ph...@apache.org>
Committed: Thu Jul 19 10:28:38 2018 -0700

----------------------------------------------------------------------
 src/c/src/zookeeper.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zookeeper/blob/4c12f75a/src/c/src/zookeeper.c
----------------------------------------------------------------------
diff --git a/src/c/src/zookeeper.c b/src/c/src/zookeeper.c
index d38e172..6dfa402 100644
--- a/src/c/src/zookeeper.c
+++ b/src/c/src/zookeeper.c
@@ -4246,6 +4246,10 @@ const char* zerror(int c)
       return "bad arguments";
     case ZINVALIDSTATE:
       return "invalid zhandle state";
+    case ZNEWCONFIGNOQUORUM:
+      return "no quorum of new config is connected and up-to-date with the leader of last commmitted config - try invoking reconfiguration after new servers are connected and synced";
+    case ZRECONFIGINPROGRESS:
+      return "Another reconfiguration is in progress -- concurrent reconfigs not supported (yet)";
     case ZAPIERROR:
       return "api error";
     case ZNONODE:
@@ -4276,10 +4280,12 @@ const char* zerror(int c)
       return "session moved to another server, so operation is ignored";
     case ZNOTREADONLY:
       return "state-changing request is passed to read-only server";
-   case ZNEWCONFIGNOQUORUM:
-       return "no quorum of new config is connected and up-to-date with the leader of last commmitted config - try invoking reconfiguration after new servers are connected and synced";
-   case ZRECONFIGINPROGRESS:
-     return "Another reconfiguration is in progress -- concurrent reconfigs not supported (yet)";
+    case ZEPHEMERALONLOCALSESSION:
+      return "attempt to create ephemeral node on a local session";
+    case ZNOWATCHER:
+      return "the watcher couldn't be found";
+    case ZRECONFIGDISABLED:
+      return "attempts to perform a reconfiguration operation when reconfiguration feature is disable";
     }
     if (c > 0) {
       return strerror(c);