You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2021/06/03 20:49:34 UTC

[GitHub] [geode] jdeppe-pivotal opened a new pull request #6560: GEODE-9168: Remove radish function execution

jdeppe-pivotal opened a new pull request #6560:
URL: https://github.com/apache/geode/pull/6560


   - Removed CommandFunction, SingleResultRedisFunction and all
     *FunctionInvoker classes.
   - Move necessary functionality out of CommandHelper and into
     RegionProvider.
   
   Thank you for submitting a contribution to Apache Geode.
   
   In order to streamline the review of the contribution we ask you
   to ensure the following steps have been taken:
   
   ### For all changes:
   - [ ] Is there a JIRA ticket associated with this PR? Is it referenced in the commit message?
   
   - [ ] Has your PR been rebased against the latest commit within the target branch (typically `develop`)?
   
   - [ ] Is your initial contribution a single, squashed commit?
   
   - [ ] Does `gradlew build` run cleanly?
   
   - [ ] Have you written or updated unit tests to verify your changes?
   
   - [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)?
   
   ### Note:
   Please ensure that once the PR is submitted, check Concourse for build issues and
   submit an update to your PR as soon as possible. If you need help, please send an
   email to dev@geode.apache.org.
   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [geode] DonalEvans commented on a change in pull request #6560: GEODE-9168: Remove radish function execution

Posted by GitBox <gi...@apache.org>.
DonalEvans commented on a change in pull request #6560:
URL: https://github.com/apache/geode/pull/6560#discussion_r645759232



##########
File path: geode-apis-compatible-with-redis/src/main/java/org/apache/geode/redis/internal/executor/string/StringExecutor.java
##########
@@ -16,11 +16,7 @@
 
 
 import org.apache.geode.redis.internal.executor.AbstractExecutor;
-import org.apache.geode.redis.internal.netty.ExecutionHandlerContext;
 
 public abstract class StringExecutor extends AbstractExecutor {

Review comment:
       The `StringExecutor` is now an empty class and so should probably be removed, unless there's some common behaviour in all the Executors that extend it that could be pulled into it.

##########
File path: geode-apis-compatible-with-redis/src/main/java/org/apache/geode/redis/internal/netty/ExecutionHandlerContext.java
##########
@@ -272,6 +269,19 @@ private RedisResponse getExceptionResponse(ChannelHandlerContext ctx, Throwable
     return response;
   }
 
+  private static Throwable getInitialCause(FunctionException ex) {
+    Throwable result = ex.getCause();
+    while (result != null && result.getCause() != null) {
+      result = result.getCause();
+    }

Review comment:
       This section can be replaced with a call to `ex.getRootCause()` I think.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [geode] jdeppe-pivotal commented on pull request #6560: GEODE-9168: Remove radish function execution

Posted by GitBox <gi...@apache.org>.
jdeppe-pivotal commented on pull request #6560:
URL: https://github.com/apache/geode/pull/6560#issuecomment-855828595


   @upthewaterspout Initially, I thought it was redundant, but have restored it and reworked it somewhat. It showed up a problem with future `MOVED` work that is based on this PR. So thanks for that prompt!


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [geode] jdeppe-pivotal commented on a change in pull request #6560: GEODE-9168: Remove radish function execution

Posted by GitBox <gi...@apache.org>.
jdeppe-pivotal commented on a change in pull request #6560:
URL: https://github.com/apache/geode/pull/6560#discussion_r645711141



##########
File path: geode-apis-compatible-with-redis/src/main/java/org/apache/geode/redis/internal/data/RedisKeyCommandsFunctionExecutor.java
##########
@@ -93,7 +94,61 @@ public String internalType(RedisKey key) {
 
   @Override
   public boolean rename(RedisKey oldKey, RedisKey newKey) {
-    // caller has already done all the stripedExecutor locking
-    return getRedisData(oldKey).rename(getRegion(), oldKey, newKey);
+    RedisKey firstLock;
+    RedisKey secondLock;
+    if (arrayCmp(oldKey.toBytes(), newKey.toBytes()) > 0) {

Review comment:
       Should be fixed now.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [geode] upthewaterspout commented on a change in pull request #6560: GEODE-9168: Remove radish function execution

Posted by GitBox <gi...@apache.org>.
upthewaterspout commented on a change in pull request #6560:
URL: https://github.com/apache/geode/pull/6560#discussion_r647620570



##########
File path: geode-apis-compatible-with-redis/src/main/java/org/apache/geode/redis/internal/RegionProvider.java
##########
@@ -45,15 +73,33 @@
 
   public static final int REDIS_SLOTS_PER_BUCKET = REDIS_SLOTS / REDIS_REGION_BUCKETS;
 
+  private static final Map<RedisDataType, RedisData> nullTypes = new HashMap<>();

Review comment:
       Could be an EnumMap. Also, maybe it should be `NULL_TYPES` since it's static?

##########
File path: geode-apis-compatible-with-redis/src/main/java/org/apache/geode/redis/internal/data/RedisKey.java
##########
@@ -63,7 +63,7 @@ public RedisKey(byte[] value) {
 
   public int getBucketId() {
     // & (REDIS_SLOTS - 1) is equivalent to % REDIS_SLOTS but supposedly faster
-    return getCrc16() & (REDIS_SLOTS - 1) / REDIS_SLOTS_PER_BUCKET;
+    return (getCrc16() & (REDIS_SLOTS - 1)) / REDIS_SLOTS_PER_BUCKET;

Review comment:
       Whoa!




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [geode] sabbey37 commented on a change in pull request #6560: GEODE-9168: Remove radish function execution

Posted by GitBox <gi...@apache.org>.
sabbey37 commented on a change in pull request #6560:
URL: https://github.com/apache/geode/pull/6560#discussion_r645665869



##########
File path: geode-apis-compatible-with-redis/src/main/java/org/apache/geode/redis/internal/data/RedisKeyCommandsFunctionExecutor.java
##########
@@ -93,7 +94,61 @@ public String internalType(RedisKey key) {
 
   @Override
   public boolean rename(RedisKey oldKey, RedisKey newKey) {
-    // caller has already done all the stripedExecutor locking
-    return getRedisData(oldKey).rename(getRegion(), oldKey, newKey);
+    RedisKey firstLock;
+    RedisKey secondLock;
+    if (arrayCmp(oldKey.toBytes(), newKey.toBytes()) > 0) {

Review comment:
       I noticed we're just comparing the bytes now.... I'm wondering if we'll have issues with stripe differences.  We might encounter a deadlock.  If we compared the stripes, I think that would eliminate the need for the byte array comparison.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [geode] jdeppe-pivotal commented on a change in pull request #6560: GEODE-9168: Remove radish function execution

Posted by GitBox <gi...@apache.org>.
jdeppe-pivotal commented on a change in pull request #6560:
URL: https://github.com/apache/geode/pull/6560#discussion_r645711054



##########
File path: geode-apis-compatible-with-redis/src/main/resources/org/apache/geode/redis/internal/sanctioned-geode-apis-compatible-with-redis-serializables.txt
##########
@@ -7,9 +7,6 @@ org/apache/geode/redis/internal/data/RedisDataType,false,toStringValue:java/lang
 org/apache/geode/redis/internal/data/RedisDataTypeMismatchException,true,-2451663685348513870
 org/apache/geode/redis/internal/delta/DeltaType,false
 org/apache/geode/redis/internal/executor/BaseSetOptions$Exists,false
-org/apache/geode/redis/internal/executor/CommandFunction,true,-1302506316316454732
-org/apache/geode/redis/internal/executor/SingleResultRedisFunction,true,3239452234149879302
-org/apache/geode/redis/internal/executor/key/RenameFunction,true,7047473969356686453

Review comment:
       RIP




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [geode] jdeppe-pivotal merged pull request #6560: GEODE-9168: Remove radish function execution

Posted by GitBox <gi...@apache.org>.
jdeppe-pivotal merged pull request #6560:
URL: https://github.com/apache/geode/pull/6560


   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [geode] sabbey37 commented on a change in pull request #6560: GEODE-9168: Remove radish function execution

Posted by GitBox <gi...@apache.org>.
sabbey37 commented on a change in pull request #6560:
URL: https://github.com/apache/geode/pull/6560#discussion_r645665869



##########
File path: geode-apis-compatible-with-redis/src/main/java/org/apache/geode/redis/internal/data/RedisKeyCommandsFunctionExecutor.java
##########
@@ -93,7 +94,61 @@ public String internalType(RedisKey key) {
 
   @Override
   public boolean rename(RedisKey oldKey, RedisKey newKey) {
-    // caller has already done all the stripedExecutor locking
-    return getRedisData(oldKey).rename(getRegion(), oldKey, newKey);
+    RedisKey firstLock;
+    RedisKey secondLock;
+    if (arrayCmp(oldKey.toBytes(), newKey.toBytes()) > 0) {

Review comment:
       I noticed we're just comparing the bytes now.... I'm wondering if we'll have issues if both keys are on the same stripe.  We might encounter a deadlock.  I think that would eliminate the need for the byte array comparison.

##########
File path: geode-apis-compatible-with-redis/src/main/resources/org/apache/geode/redis/internal/sanctioned-geode-apis-compatible-with-redis-serializables.txt
##########
@@ -7,9 +7,6 @@ org/apache/geode/redis/internal/data/RedisDataType,false,toStringValue:java/lang
 org/apache/geode/redis/internal/data/RedisDataTypeMismatchException,true,-2451663685348513870
 org/apache/geode/redis/internal/delta/DeltaType,false
 org/apache/geode/redis/internal/executor/BaseSetOptions$Exists,false
-org/apache/geode/redis/internal/executor/CommandFunction,true,-1302506316316454732
-org/apache/geode/redis/internal/executor/SingleResultRedisFunction,true,3239452234149879302
-org/apache/geode/redis/internal/executor/key/RenameFunction,true,7047473969356686453

Review comment:
       A moment of silence for the RenameFunction. 🕯️ 




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [geode] sabbey37 commented on a change in pull request #6560: GEODE-9168: Remove radish function execution

Posted by GitBox <gi...@apache.org>.
sabbey37 commented on a change in pull request #6560:
URL: https://github.com/apache/geode/pull/6560#discussion_r645665869



##########
File path: geode-apis-compatible-with-redis/src/main/java/org/apache/geode/redis/internal/data/RedisKeyCommandsFunctionExecutor.java
##########
@@ -93,7 +94,61 @@ public String internalType(RedisKey key) {
 
   @Override
   public boolean rename(RedisKey oldKey, RedisKey newKey) {
-    // caller has already done all the stripedExecutor locking
-    return getRedisData(oldKey).rename(getRegion(), oldKey, newKey);
+    RedisKey firstLock;
+    RedisKey secondLock;
+    if (arrayCmp(oldKey.toBytes(), newKey.toBytes()) > 0) {

Review comment:
       I noticed we're just comparing the bytes now.... I'm wondering if we'll have issues with stripe differences.  We might encounter a deadlock.  I think that would eliminate the need for the byte array comparison.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [geode] jdeppe-pivotal commented on a change in pull request #6560: GEODE-9168: Remove radish function execution

Posted by GitBox <gi...@apache.org>.
jdeppe-pivotal commented on a change in pull request #6560:
URL: https://github.com/apache/geode/pull/6560#discussion_r646483360



##########
File path: geode-apis-compatible-with-redis/src/main/java/org/apache/geode/redis/internal/netty/ExecutionHandlerContext.java
##########
@@ -272,6 +269,19 @@ private RedisResponse getExceptionResponse(ChannelHandlerContext ctx, Throwable
     return response;
   }
 
+  private static Throwable getInitialCause(FunctionException ex) {
+    Throwable result = ex.getCause();
+    while (result != null && result.getCause() != null) {
+      result = result.getCause();
+    }

Review comment:
       Changed - thanks!




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [geode] jdeppe-pivotal commented on a change in pull request #6560: GEODE-9168: Remove radish function execution

Posted by GitBox <gi...@apache.org>.
jdeppe-pivotal commented on a change in pull request #6560:
URL: https://github.com/apache/geode/pull/6560#discussion_r646483767



##########
File path: geode-apis-compatible-with-redis/src/main/java/org/apache/geode/redis/internal/executor/string/StringExecutor.java
##########
@@ -16,11 +16,7 @@
 
 
 import org.apache.geode.redis.internal.executor.AbstractExecutor;
-import org.apache.geode.redis.internal.netty.ExecutionHandlerContext;
 
 public abstract class StringExecutor extends AbstractExecutor {

Review comment:
       I've removed it as well as `HashExecutor` and `SetExecutor`.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org