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

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


The following commit(s) were added to refs/heads/master by this push:
     new d15c475  IGNITE-9739 fix NPE on MVCC path - Fixes #5846.
d15c475 is described below

commit d15c475fc960534588c4e66b2fccdbef4bc1ff63
Author: Sergey Kosarev <[email protected]>
AuthorDate: Thu Jan 17 17:48:09 2019 +0300

    IGNITE-9739 fix NPE on MVCC path - Fixes #5846.
    
    Signed-off-by: Ivan Rakov <[email protected]>
---
 .../processors/cache/transactions/IgniteTxManager.java       | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
index e55676c..6c11cbc 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
@@ -2429,8 +2429,9 @@ public class IgniteTxManager extends 
GridCacheSharedManagerAdapter {
             cctx.database().checkpointReadLock();
 
             try {
-                if (cctx.wal() != null)
-                    ptr = cctx.wal().log(newTxRecord(tx));
+                TxRecord rec;
+                if (cctx.wal() != null && (rec = newTxRecord(tx)) != null)
+                    cctx.wal().log(rec);
 
                 cctx.coordinators().updateState(tx.mvccSnapshot, commit ? 
TxState.COMMITTED : TxState.ABORTED, tx.local());
             }
@@ -2454,8 +2455,9 @@ public class IgniteTxManager extends 
GridCacheSharedManagerAdapter {
             cctx.database().checkpointReadLock();
 
             try {
-                if (cctx.wal() != null)
-                    cctx.wal().log(newTxRecord(tx));
+                TxRecord rec;
+                if (cctx.wal() != null && (rec = newTxRecord(tx)) != null)
+                    cctx.wal().log(rec);
 
                 cctx.coordinators().updateState(tx.mvccSnapshot, 
TxState.PREPARED);
             }
@@ -2497,7 +2499,7 @@ public class IgniteTxManager extends 
GridCacheSharedManagerAdapter {
      * @param tx Transaction.
      * @return Tx state record.
      */
-    private TxRecord newTxRecord(IgniteTxAdapter tx) {
+    private @Nullable TxRecord newTxRecord(IgniteTxAdapter tx) {
         BaselineTopology baselineTop = 
cctx.kernalContext().state().clusterState().baselineTopology();
 
         if (baselineTop != null && 
baselineTop.consistentIds().contains(cctx.localNode().consistentId())) {

Reply via email to