From f7a0323895679b713ae8d50ed7ff36a8a9c4c6dd Mon Sep 17 00:00:00 2001 From: Bharath Vissapragada Date: Wed, 7 Apr 2021 10:51:20 -0700 Subject: [PATCH] HBASE-25743: Retry REQUESTTIMEOUT based KeeperExceptions in ZK client. Starting ZOOKEEPER-2251, client requests exceeding a timeout can throw a KeeperException with REQUESTTIMEOUT opcode set. RecoverableZookeeper doesn't transparently retry in such cases. --- .../hbase/zookeeper/RecoverableZooKeeper.java | 29 ++++++------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/hbase-zookeeper/src/main/java/org/apache/hadoop/hbase/zookeeper/RecoverableZooKeeper.java b/hbase-zookeeper/src/main/java/org/apache/hadoop/hbase/zookeeper/RecoverableZooKeeper.java index 9cc1ab21bde..71fbf9a7069 100644 --- a/hbase-zookeeper/src/main/java/org/apache/hadoop/hbase/zookeeper/RecoverableZooKeeper.java +++ b/hbase-zookeeper/src/main/java/org/apache/hadoop/hbase/zookeeper/RecoverableZooKeeper.java @@ -182,9 +182,8 @@ public class RecoverableZooKeeper { throw e; case CONNECTIONLOSS: - retryOrThrow(retryCounter, e, "delete"); - break; case OPERATIONTIMEOUT: + case REQUESTTIMEOUT: retryOrThrow(retryCounter, e, "delete"); break; @@ -222,9 +221,8 @@ public class RecoverableZooKeeper { } catch (KeeperException e) { switch (e.code()) { case CONNECTIONLOSS: - retryOrThrow(retryCounter, e, "exists"); - break; case OPERATIONTIMEOUT: + case REQUESTTIMEOUT: retryOrThrow(retryCounter, e, "exists"); break; @@ -279,9 +277,8 @@ public class RecoverableZooKeeper { } catch (KeeperException e) { switch (e.code()) { case CONNECTIONLOSS: - retryOrThrow(retryCounter, e, "getChildren"); - break; case OPERATIONTIMEOUT: + case REQUESTTIMEOUT: retryOrThrow(retryCounter, e, "getChildren"); break; @@ -328,9 +325,8 @@ public class RecoverableZooKeeper { } catch (KeeperException e) { switch (e.code()) { case CONNECTIONLOSS: - retryOrThrow(retryCounter, e, "getData"); - break; case OPERATIONTIMEOUT: + case REQUESTTIMEOUT: retryOrThrow(retryCounter, e, "getData"); break; @@ -370,9 +366,8 @@ public class RecoverableZooKeeper { } catch (KeeperException e) { switch (e.code()) { case CONNECTIONLOSS: - retryOrThrow(retryCounter, e, "setData"); - break; case OPERATIONTIMEOUT: + case REQUESTTIMEOUT: retryOrThrow(retryCounter, e, "setData"); break; case BADVERSION: @@ -415,9 +410,8 @@ public class RecoverableZooKeeper { } catch (KeeperException e) { switch (e.code()) { case CONNECTIONLOSS: - retryOrThrow(retryCounter, e, "getAcl"); - break; case OPERATIONTIMEOUT: + case REQUESTTIMEOUT: retryOrThrow(retryCounter, e, "getAcl"); break; @@ -444,8 +438,6 @@ public class RecoverableZooKeeper { } catch (KeeperException e) { switch (e.code()) { case CONNECTIONLOSS: - retryOrThrow(retryCounter, e, "setAcl"); - break; case OPERATIONTIMEOUT: retryOrThrow(retryCounter, e, "setAcl"); break; @@ -524,9 +516,8 @@ public class RecoverableZooKeeper { throw e; case CONNECTIONLOSS: - retryOrThrow(retryCounter, e, "create"); - break; case OPERATIONTIMEOUT: + case REQUESTTIMEOUT: retryOrThrow(retryCounter, e, "create"); break; @@ -559,9 +550,8 @@ public class RecoverableZooKeeper { } catch (KeeperException e) { switch (e.code()) { case CONNECTIONLOSS: - retryOrThrow(retryCounter, e, "create"); - break; case OPERATIONTIMEOUT: + case REQUESTTIMEOUT: retryOrThrow(retryCounter, e, "create"); break; @@ -615,9 +605,8 @@ public class RecoverableZooKeeper { } catch (KeeperException e) { switch (e.code()) { case CONNECTIONLOSS: - retryOrThrow(retryCounter, e, "multi"); - break; case OPERATIONTIMEOUT: + case REQUESTTIMEOUT: retryOrThrow(retryCounter, e, "multi"); break;