nizhikov commented on a change in pull request #9345:
URL: https://github.com/apache/ignite/pull/9345#discussion_r823806218



##########
File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java
##########
@@ -801,17 +802,32 @@ else if (op == READ) {
 
                         cctx.mvccCaching().onTxFinished(this, true);
 
-                        if (!near() && !F.isEmpty(dataEntries) && cctx.wal() 
!= null) {
+                        boolean walEnabled = false;
+
+                        // Log only there are at least one persistent or cdc 
enabled group.
+                        if (!near() && !F.isEmpty(dataEntries) && 
cctx.cdcWal() != null) {
+                            for (int i = 0; i < dataEntries.size(); i++) {
+                                CacheGroupContext grpCtx = 
dataEntries.get(i).get2().context().group();
+
+                                if (grpCtx.walOrCdcEnabled()) {
+                                    walEnabled = true;
+
+                                    break;
+                                }
+                            }
+                        }
+
+                        if (walEnabled) {
                             // Set new update counters for data entries 
received from persisted tx entries.
                             List<DataEntry> entriesWithCounters = 
dataEntries.stream()
                                 .map(tuple -> 
tuple.get1().partitionCounter(tuple.get2().updateCounter()))
                                 .collect(Collectors.toList());
 
-                            ptr = cctx.wal().log(new 
DataRecord(entriesWithCounters));
+                            ptr = cctx.cdcWal().log(new 
DataRecord(entriesWithCounters));
                         }
 
                         if (ptr != null)
-                            cctx.wal().flush(ptr, false);
+                            cctx.cdcWal().flush(ptr, false);

Review comment:
       > wal = cctx.wal() != null ? cctx.wal() : cctx.cdcWal()
   
   OK. Implemented inside`wal(boolean)` method.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to