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 2022/01/29 00:37:22 UTC
[GitHub] [geode] ezoerner commented on a change in pull request #7328: GEODE-9994 Make Redis RENAME atomic
ezoerner commented on a change in pull request #7328:
URL: https://github.com/apache/geode/pull/7328#discussion_r794969847
##########
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:
This follows the pattern in MSetDUnitTest `testMSet_crashDoesNotLeaveInconsistencies` which Jens wrote. I believe the purpose of this line to make sure there are keys hosted on the server that is about to be crashed.
--
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: notifications-unsubscribe@geode.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org