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.

Reviewed-by: Rushabh Shah <rushabh.shah@salesforce.com>
Signed-off-by: Michael Stack <stack@apache.org>

(cherry picked from commit f7a0323895)
This commit is contained in:
Bharath Vissapragada 2021-04-07 10:51:20 -07:00
parent 8ff17c68e2
commit 94a19b5b35
No known key found for this signature in database
GPG Key ID: 18AE42A0B5A93FA7
1 changed files with 9 additions and 20 deletions

View File

@ -184,9 +184,8 @@ public class RecoverableZooKeeper {
throw e;
case CONNECTIONLOSS:
retryOrThrow(retryCounter, e, "delete");
break;
case OPERATIONTIMEOUT:
case REQUESTTIMEOUT:
retryOrThrow(retryCounter, e, "delete");
break;
@ -215,9 +214,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;
@ -285,9 +283,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;
@ -347,9 +344,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;
@ -414,9 +410,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:
@ -461,9 +456,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;
@ -492,8 +486,6 @@ public class RecoverableZooKeeper {
} catch (KeeperException e) {
switch (e.code()) {
case CONNECTIONLOSS:
retryOrThrow(retryCounter, e, "setAcl");
break;
case OPERATIONTIMEOUT:
retryOrThrow(retryCounter, e, "setAcl");
break;
@ -575,9 +567,8 @@ public class RecoverableZooKeeper {
throw e;
case CONNECTIONLOSS:
retryOrThrow(retryCounter, e, "create");
break;
case OPERATIONTIMEOUT:
case REQUESTTIMEOUT:
retryOrThrow(retryCounter, e, "create");
break;
@ -612,9 +603,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;
@ -670,9 +660,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;