zstan commented on code in PR #13316:
URL: https://github.com/apache/ignite/pull/13316#discussion_r3576493536


##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicAbstractUpdateFuture.java:
##########
@@ -153,6 +157,9 @@ public abstract class GridNearAtomicAbstractUpdateFuture 
extends GridCacheFuture
     /** Handle binary in interceptor operation flag. */
     protected boolean keepBinaryInInterceptor;
 
+    /** Near entries reserved against eviction for the time of update. */
+    protected Map<KeyCacheObject, GridNearCacheEntry> reservedEntries;

Review Comment:
   ```suggestion
       private Map<KeyCacheObject, GridNearCacheEntry> reservedEntries;
   ```



##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicAbstractUpdateFuture.java:
##########
@@ -153,6 +157,9 @@ public abstract class GridNearAtomicAbstractUpdateFuture 
extends GridCacheFuture
     /** Handle binary in interceptor operation flag. */
     protected boolean keepBinaryInInterceptor;
 
+    /** Near entries reserved against eviction for the time of update. */
+    protected Map<KeyCacheObject, GridNearCacheEntry> reservedEntries;

Review Comment:
   As i can see - this structure and all logic about it is acceptable only for 
caches with confidured eviction, otherwize it useless, if i\`m right it need to 
be fixed.



##########
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/IgniteCacheAtomicProtocolTest.java:
##########
@@ -864,6 +868,114 @@ private void readerUpdateDhtFails(boolean 
updateNearEnabled,
         checkData(map);
     }
 
+    /**
+     * @throws Exception If failed.
+     */
+    @Test
+    public void testNearEntryUpdateRacePut() throws Exception {
+        nearEntryUpdateRace(cache -> cache.put(0, 1), F.asMap(0, 2));
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    @Test
+    public void testNearEntryUpdateRacePutIfAbsent() throws Exception {
+        nearEntryUpdateRace(cache -> assertTrue(cache.putIfAbsent(0, 1)), 
F.asMap(0, 2));
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    @Test
+    public void testNearEntryUpdateRaceInvoke() throws Exception {
+        nearEntryUpdateRace(cache -> cache.invoke(0, new 
SetValueEntryProcessor(1)), F.asMap(0, 2));
+    }

Review Comment:
   I see these tests are also passed for PRIMARY_SYNC mode, can you add it ? 
And what about FULL_ASYNC mode ?



-- 
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