DonalEvans commented on a change in pull request #7507:
URL: https://github.com/apache/geode/pull/7507#discussion_r838928446



##########
File path: 
geode-for-redis/src/main/java/org/apache/geode/redis/internal/data/RedisList.java
##########
@@ -221,17 +221,18 @@ public long lpush(ExecutionHandlerContext context, 
List<byte[]> elementsToAdd,
    */
   public int lrem(int count, byte[] element, Region<RedisKey, RedisData> 
region, RedisKey key) {
     List<Integer> removedIndexes;
-    byte version;
+    byte newVersion;
     synchronized (this) {
       removedIndexes = elementList.remove(element, count);
-      version = incrementAndGetVersion();
-    }
+      if (removedIndexes.isEmpty()) {
+        return 0;
+      }
 
-    if (!removedIndexes.isEmpty()) {
-      storeChanges(region, key,
-          new RemoveElementsByIndex(version, removedIndexes));
+      newVersion = incrementAndGetVersion();

Review comment:
       I think it would definitely be better to create a ticket for the issue, 
as otherwise there's no record of what it is or what the fix was. The fix looks 
pretty small and straightforward, so hopefully it shouldn't take too long to 
get the PR up and merged. Please ping me on Slack if you need a review for it, 
as I don't want to hold things up if you're just about to go on vacation.




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