ezoerner commented on a change in pull request #7328:
URL: https://github.com/apache/geode/pull/7328#discussion_r794971759



##########
File path: 
geode-for-redis/src/distributedTest/java/org/apache/geode/redis/internal/commands/executor/key/RenameDUnitTest.java
##########
@@ -210,6 +227,48 @@ private void doConcurrentRenames(List<String> listOfKeys1, 
List<String> listOfKe
     future4.get();
   }
 
+  @Test
+  public void givenCrashDuringRename_thenDoesNotLeaveInconsistencies() throws 
Exception {
+    final AtomicBoolean running = new AtomicBoolean(true);
+
+    final List<String> hashtags = new ArrayList<>();
+    hashtags.add(clusterStartUp.getKeyOnServer("rename", 1));
+    hashtags.add(clusterStartUp.getKeyOnServer("rename", 2));
+    hashtags.add(clusterStartUp.getKeyOnServer("rename", 3));
+
+    final Runnable task1 = () -> renamePerformAndVerify(1, 10000, 
hashtags.get(0), running, true);
+    final Runnable task2 = () -> renamePerformAndVerify(2, 10000, 
hashtags.get(1), running, true);
+    final Runnable task3 = () -> renamePerformAndVerify(3, 10000, 
hashtags.get(2), running, true);
+
+    final Future<Void> future1 = executor.runAsync(task1);
+    final Future<Void> future2 = executor.runAsync(task2);
+    final Future<Void> future3 = executor.runAsync(task3);
+
+    final String finalRedisPort = Integer.toString(server3Port);
+    final int finalLocatorPort = locatorPort;
+    final Future<?> crasherFuture = executor.submit(() -> {
+      try {
+        for (int i = 0; i < 20 && running.get(); i++) {
+          clusterStartUp.moveBucketForKey(hashtags.get(0), "server-3");

Review comment:
       Perhaps when the server has previously crashed there may not be keys 
hosted there anymore. Maybe Jens can comment on this as well if there's more to 
it than this.




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