This is an automated email from the ASF dual-hosted git repository.
achouhan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/phoenix.git
The following commit(s) were added to refs/heads/master by this push:
new 77c6cb3 PHOENIX-5931 PhoenixIndexFailurePolicy throws NPE if cause of
IOE is null
77c6cb3 is described below
commit 77c6cb32fce04b912b7c502dc170d86af8293fe6
Author: Abhishek Singh Chouhan <[email protected]>
AuthorDate: Mon Jun 1 19:55:04 2020 -0700
PHOENIX-5931 PhoenixIndexFailurePolicy throws NPE if cause of IOE is null
---
.../org/apache/phoenix/coprocessor/IndexRebuildRegionScanner.java | 5 +++--
.../java/org/apache/phoenix/index/PhoenixIndexFailurePolicy.java | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git
a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/IndexRebuildRegionScanner.java
b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/IndexRebuildRegionScanner.java
index 812a6f6..40c6d57 100644
---
a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/IndexRebuildRegionScanner.java
+++
b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/IndexRebuildRegionScanner.java
@@ -1209,8 +1209,9 @@ public class IndexRebuildRegionScanner extends
GlobalIndexRegionScanner {
}
}
}
- } catch (IOException e) {
- LOGGER.error("IOException during rebuilding: " +
Throwables.getStackTraceAsString(e));
+ } catch (Throwable e) {
+ LOGGER.error("Exception in IndexRebuildRegionScanner for region "
+ + region.getRegionInfo().getRegionNameAsString(), e);
throw e;
} finally {
region.closeRegionOperation();
diff --git
a/phoenix-core/src/main/java/org/apache/phoenix/index/PhoenixIndexFailurePolicy.java
b/phoenix-core/src/main/java/org/apache/phoenix/index/PhoenixIndexFailurePolicy.java
index a0a765c..f06df71 100644
---
a/phoenix-core/src/main/java/org/apache/phoenix/index/PhoenixIndexFailurePolicy.java
+++
b/phoenix-core/src/main/java/org/apache/phoenix/index/PhoenixIndexFailurePolicy.java
@@ -493,7 +493,7 @@ public class PhoenixIndexFailurePolicy extends
DelegateIndexFailurePolicy {
return;
} catch (IOException e) {
SQLException inferredE =
ServerUtil.parseLocalOrRemoteServerException(e);
- if (inferredE == null || inferredE.getErrorCode() !=
SQLExceptionCode.INDEX_WRITE_FAILURE.getErrorCode()) {
+ if (inferredE != null && inferredE.getErrorCode() !=
SQLExceptionCode.INDEX_WRITE_FAILURE.getErrorCode()) {
// If this call is from phoenix client, we also need to
check if SQLException
// error is INDEX_METADATA_NOT_FOUND or not
// if it's not an INDEX_METADATA_NOT_FOUND, throw
exception,