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/03/03 21:32:13 UTC

[GitHub] [geode] jhutchison opened a new pull request #6084: GEODE-8859: fix redis-compatability data structure bucket memory-usag…

jhutchison opened a new pull request #6084:
URL: https://github.com/apache/geode/pull/6084


   …e reporting
   
   -implement default getForceReCalculateSize in RedisData interface
   -expose dataStoreBytesInUse on GeodeRedisServer
   -expose dataStoreBytesInUse on GeodeRedisService
   -expose dataStoreBytesInUse on RedisClusterStartupRule
   
   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] jdeppe-pivotal merged pull request #6084: GEODE-8859: fix redis-compatability data structure bucket memory-usag…

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


   


----------------------------------------------------------------
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] jhutchison commented on a change in pull request #6084: GEODE-8859: fix redis-compatability data structure bucket memory-usag…

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



##########
File path: geode-redis/src/distributedTest/java/org/apache/geode/redis/internal/data/BucketSizeTest.java
##########
@@ -0,0 +1,70 @@
+package org.apache.geode.redis.internal.data;

Review comment:
       will add - thx

##########
File path: geode-redis/src/distributedTest/java/org/apache/geode/redis/internal/data/ParitionedRegionStatsUpdateTest.java
##########
@@ -0,0 +1,59 @@
+package org.apache.geode.redis.internal.data;

Review comment:
       will add - thx




----------------------------------------------------------------
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 #6084: GEODE-8859: fix redis-compatability data structure bucket memory-usag…

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



##########
File path: geode-redis/src/distributedTest/java/org/apache/geode/redis/internal/data/ParitionedRegionStatsUpdateTest.java
##########
@@ -0,0 +1,59 @@
+package org.apache.geode.redis.internal.data;
+
+import static org.apache.geode.distributed.ConfigurationProperties.MAX_WAIT_TIME_RECONNECT;
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.Properties;
+
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Test;
+import redis.clients.jedis.Jedis;
+
+import org.apache.geode.test.awaitility.GeodeAwaitility;
+import org.apache.geode.test.dunit.rules.MemberVM;
+import org.apache.geode.test.dunit.rules.RedisClusterStartupRule;
+
+public class ParitionedRegionStatsUpdateTest {

Review comment:
       `Partitioned` is spelled incorrectly.

##########
File path: geode-redis/src/distributedTest/java/org/apache/geode/redis/internal/data/ParitionedRegionStatsUpdateTest.java
##########
@@ -0,0 +1,59 @@
+package org.apache.geode.redis.internal.data;
+
+import static org.apache.geode.distributed.ConfigurationProperties.MAX_WAIT_TIME_RECONNECT;
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.Properties;
+
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Test;
+import redis.clients.jedis.Jedis;
+
+import org.apache.geode.test.awaitility.GeodeAwaitility;
+import org.apache.geode.test.dunit.rules.MemberVM;
+import org.apache.geode.test.dunit.rules.RedisClusterStartupRule;
+
+public class ParitionedRegionStatsUpdateTest {
+
+  @ClassRule
+  public static RedisClusterStartupRule clusterStartUpRule = new RedisClusterStartupRule(2);
+
+  private static MemberVM server1;
+  private static final String LOCAL_HOST = "127.0.0.1";
+  private static final int JEDIS_TIMEOUT =
+      Math.toIntExact(GeodeAwaitility.getTimeout().toMillis());
+
+  private static Jedis jedis1;
+
+  @BeforeClass
+  public static void classSetup() {
+    Properties locatorProperties = new Properties();
+    locatorProperties.setProperty(MAX_WAIT_TIME_RECONNECT, "15000");
+
+    MemberVM locator = clusterStartUpRule.startLocatorVM(0, locatorProperties);
+    int locatorPort = locator.getPort();
+
+    server1 = clusterStartUpRule.startRedisVM(1, locatorPort);
+    int redisServerPort1 = clusterStartUpRule.getRedisPort(1);
+
+    jedis1 = new Jedis(LOCAL_HOST, redisServerPort1, JEDIS_TIMEOUT);
+  }
+
+  @Test
+  public void should_showIncreaseInDatastoreBytesInUse_givenValueSizeIncreases() {
+    String KEY = "key";
+    String LONG_APPEND_VALUE = String.valueOf(Integer.MAX_VALUE);
+    jedis1.set(KEY, "value");
+
+    long initialDataStoreBytesInUse =
+        clusterStartUpRule.getDataStoreBytesInUseForDataRegion(server1);
+
+    for (int i = 0; i < 1000; i++) {
+      jedis1.append(KEY, LONG_APPEND_VALUE);
+    }
+
+    long finalDataStoreBytesInUse = clusterStartUpRule.getDataStoreBytesInUseForDataRegion(server1);
+    assertThat(initialDataStoreBytesInUse).isLessThan(finalDataStoreBytesInUse);
+  }

Review comment:
       This test seems like it's testing the same thing as the`should_show_increase_in_dataStore_bytes_in_use_given_data_added` test in `BucketSizeTest.java`.  Are they supposed to be testing different things?




----------------------------------------------------------------
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] dschneider-pivotal commented on a change in pull request #6084: GEODE-8859: fix redis-compatability data structure bucket memory-usag…

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



##########
File path: geode-redis/src/distributedTest/java/org/apache/geode/redis/internal/data/BucketSizeTest.java
##########
@@ -0,0 +1,70 @@
+package org.apache.geode.redis.internal.data;

Review comment:
       add the copyright header comment

##########
File path: geode-redis/src/distributedTest/java/org/apache/geode/redis/internal/data/ParitionedRegionStatsUpdateTest.java
##########
@@ -0,0 +1,59 @@
+package org.apache.geode.redis.internal.data;

Review comment:
       add the copyright header comment




----------------------------------------------------------------
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] jhutchison commented on a change in pull request #6084: GEODE-8859: fix redis-compatability data structure bucket memory-usag…

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



##########
File path: geode-redis/src/distributedTest/java/org/apache/geode/redis/internal/data/ParitionedRegionStatsUpdateTest.java
##########
@@ -0,0 +1,59 @@
+package org.apache.geode.redis.internal.data;
+
+import static org.apache.geode.distributed.ConfigurationProperties.MAX_WAIT_TIME_RECONNECT;
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.Properties;
+
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Test;
+import redis.clients.jedis.Jedis;
+
+import org.apache.geode.test.awaitility.GeodeAwaitility;
+import org.apache.geode.test.dunit.rules.MemberVM;
+import org.apache.geode.test.dunit.rules.RedisClusterStartupRule;
+
+public class ParitionedRegionStatsUpdateTest {

Review comment:
       thx will fix




----------------------------------------------------------------
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] jhutchison commented on a change in pull request #6084: GEODE-8859: fix redis-compatability data structure bucket memory-usag…

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



##########
File path: geode-redis/src/distributedTest/java/org/apache/geode/redis/internal/data/ParitionedRegionStatsUpdateTest.java
##########
@@ -0,0 +1,59 @@
+package org.apache.geode.redis.internal.data;
+
+import static org.apache.geode.distributed.ConfigurationProperties.MAX_WAIT_TIME_RECONNECT;
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.Properties;
+
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Test;
+import redis.clients.jedis.Jedis;
+
+import org.apache.geode.test.awaitility.GeodeAwaitility;
+import org.apache.geode.test.dunit.rules.MemberVM;
+import org.apache.geode.test.dunit.rules.RedisClusterStartupRule;
+
+public class ParitionedRegionStatsUpdateTest {
+
+  @ClassRule
+  public static RedisClusterStartupRule clusterStartUpRule = new RedisClusterStartupRule(2);
+
+  private static MemberVM server1;
+  private static final String LOCAL_HOST = "127.0.0.1";
+  private static final int JEDIS_TIMEOUT =
+      Math.toIntExact(GeodeAwaitility.getTimeout().toMillis());
+
+  private static Jedis jedis1;
+
+  @BeforeClass
+  public static void classSetup() {
+    Properties locatorProperties = new Properties();
+    locatorProperties.setProperty(MAX_WAIT_TIME_RECONNECT, "15000");
+
+    MemberVM locator = clusterStartUpRule.startLocatorVM(0, locatorProperties);
+    int locatorPort = locator.getPort();
+
+    server1 = clusterStartUpRule.startRedisVM(1, locatorPort);
+    int redisServerPort1 = clusterStartUpRule.getRedisPort(1);
+
+    jedis1 = new Jedis(LOCAL_HOST, redisServerPort1, JEDIS_TIMEOUT);
+  }
+
+  @Test
+  public void should_showIncreaseInDatastoreBytesInUse_givenValueSizeIncreases() {
+    String KEY = "key";
+    String LONG_APPEND_VALUE = String.valueOf(Integer.MAX_VALUE);
+    jedis1.set(KEY, "value");
+
+    long initialDataStoreBytesInUse =
+        clusterStartUpRule.getDataStoreBytesInUseForDataRegion(server1);
+
+    for (int i = 0; i < 1000; i++) {
+      jedis1.append(KEY, LONG_APPEND_VALUE);
+    }
+
+    long finalDataStoreBytesInUse = clusterStartUpRule.getDataStoreBytesInUseForDataRegion(server1);
+    assertThat(initialDataStoreBytesInUse).isLessThan(finalDataStoreBytesInUse);
+  }

Review comment:
       hmm-- the file is supposed to be renamed-  I guess both are in there... I'll fix.  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