This is an automated email from the ASF dual-hosted git repository.

htowaileb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/asterixdb.git


The following commit(s) were added to refs/heads/master by this push:
     new 878dcc0d80 [NO ISSUE][RT] Exception with atomic insert/upsert 
supressed by NPE
878dcc0d80 is described below

commit 878dcc0d8040747e04a8e44054a22a982ff00446
Author: Peeyush Gupta <[email protected]>
AuthorDate: Wed Nov 15 14:03:37 2023 -0800

    [NO ISSUE][RT] Exception with atomic insert/upsert supressed by NPE
    
    - user model changes: no
    - storage format changes: no
    - interface changes: no
    
    Change-Id: Ib4532f98b4d9bd41b267dc2af7b62373bce6090c
    Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/17955
    Reviewed-by: Murtadha Hubail <[email protected]>
    Reviewed-by: Peeyush Gupta <[email protected]>
    Tested-by: Peeyush Gupta <[email protected]>
---
 .../asterix/common/dataflow/LSMInsertDeleteOperatorNodePushable.java  | 4 ++--
 .../runtime/operators/LSMPrimaryInsertOperatorNodePushable.java       | 4 ++--
 .../runtime/operators/LSMPrimaryUpsertOperatorNodePushable.java       | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git 
a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/dataflow/LSMInsertDeleteOperatorNodePushable.java
 
b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/dataflow/LSMInsertDeleteOperatorNodePushable.java
index 1a23ca857c..829c9cc30b 100644
--- 
a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/dataflow/LSMInsertDeleteOperatorNodePushable.java
+++ 
b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/dataflow/LSMInsertDeleteOperatorNodePushable.java
@@ -251,7 +251,7 @@ public class LSMInsertDeleteOperatorNodePushable extends 
LSMIndexInsertUpdateDel
             final Map<String, ILSMComponentId> componentIdMap = new 
HashMap<>();
             boolean atomic = false;
             for (IIndex index : indexes) {
-                if (((ILSMIndex) index).isAtomic()) {
+                if (index != null && ((ILSMIndex) index).isAtomic()) {
                     PrimaryIndexOperationTracker opTracker =
                             ((PrimaryIndexOperationTracker) ((ILSMIndex) 
index).getOperationTracker());
                     opTracker.finishAllFlush();
@@ -279,7 +279,7 @@ public class LSMInsertDeleteOperatorNodePushable extends 
LSMIndexInsertUpdateDel
     private void abortAtomicInsertDelete() throws HyracksDataException {
         if (isPrimary) {
             for (IIndex index : indexes) {
-                if (((ILSMIndex) index).isAtomic()) {
+                if (index != null && ((ILSMIndex) index).isAtomic()) {
                     PrimaryIndexOperationTracker opTracker =
                             ((PrimaryIndexOperationTracker) ((ILSMIndex) 
index).getOperationTracker());
                     opTracker.abort();
diff --git 
a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/LSMPrimaryInsertOperatorNodePushable.java
 
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/LSMPrimaryInsertOperatorNodePushable.java
index 2c89b614b1..7891312f89 100644
--- 
a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/LSMPrimaryInsertOperatorNodePushable.java
+++ 
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/LSMPrimaryInsertOperatorNodePushable.java
@@ -354,7 +354,7 @@ public class LSMPrimaryInsertOperatorNodePushable extends 
LSMIndexInsertUpdateDe
         final Map<String, ILSMComponentId> componentIdMap = new HashMap<>();
         boolean atomic = false;
         for (IIndex index : indexes) {
-            if (((ILSMIndex) index).isAtomic()) {
+            if (index != null && ((ILSMIndex) index).isAtomic()) {
                 PrimaryIndexOperationTracker opTracker =
                         ((PrimaryIndexOperationTracker) ((ILSMIndex) 
index).getOperationTracker());
                 opTracker.finishAllFlush();
@@ -380,7 +380,7 @@ public class LSMPrimaryInsertOperatorNodePushable extends 
LSMIndexInsertUpdateDe
 
     private void abortAtomicInsert() throws HyracksDataException {
         for (IIndex index : indexes) {
-            if (((ILSMIndex) index).isAtomic()) {
+            if (index != null && ((ILSMIndex) index).isAtomic()) {
                 PrimaryIndexOperationTracker opTracker =
                         ((PrimaryIndexOperationTracker) ((ILSMIndex) 
index).getOperationTracker());
                 opTracker.abort();
diff --git 
a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/LSMPrimaryUpsertOperatorNodePushable.java
 
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/LSMPrimaryUpsertOperatorNodePushable.java
index 113a40abf4..71f699d344 100644
--- 
a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/LSMPrimaryUpsertOperatorNodePushable.java
+++ 
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/LSMPrimaryUpsertOperatorNodePushable.java
@@ -576,7 +576,7 @@ public class LSMPrimaryUpsertOperatorNodePushable extends 
LSMIndexInsertUpdateDe
         final Map<String, ILSMComponentId> componentIdMap = new HashMap<>();
         boolean atomic = false;
         for (IIndex index : indexes) {
-            if (((ILSMIndex) index).isAtomic()) {
+            if (index != null && ((ILSMIndex) index).isAtomic()) {
                 PrimaryIndexOperationTracker opTracker =
                         ((PrimaryIndexOperationTracker) ((ILSMIndex) 
index).getOperationTracker());
                 opTracker.finishAllFlush();
@@ -602,7 +602,7 @@ public class LSMPrimaryUpsertOperatorNodePushable extends 
LSMIndexInsertUpdateDe
 
     private void abortAtomicUpsert() throws HyracksDataException {
         for (IIndex index : indexes) {
-            if (((ILSMIndex) index).isAtomic()) {
+            if (index != null && ((ILSMIndex) index).isAtomic()) {
                 PrimaryIndexOperationTracker opTracker =
                         ((PrimaryIndexOperationTracker) ((ILSMIndex) 
index).getOperationTracker());
                 opTracker.abort();

Reply via email to