Skip to content
Permalink
Browse files
Incremental repair leaks SomeRepairFailedException after switch away …
…from flatMap

patch by David Capwell; reviewed by Benedict Elliott Smith for CASSANDRA-17620
  • Loading branch information
David Capwell committed May 10, 2022
1 parent 6396562 commit 89fbb1acf42c97f57ce7301674ab6f9647320c65
Showing 3 changed files with 9 additions and 3 deletions.
@@ -1,4 +1,5 @@
4.1
* Incremental repair leaks SomeRepairFailedException after switch away from flatMap (CASSANDRA-17620)
* StorageService read threshold get methods throw NullPointerException due to not handling null configs (CASSANDRA-17593)
* Rename truncate_drop guardrail to drop_truncate_table (CASSANDRA-17592)
* nodetool enablefullquerylog can NPE when directory has no files (CASSANDRA-17595)
@@ -47,6 +47,7 @@
import org.apache.cassandra.repair.messages.PrepareConsistentRequest;
import org.apache.cassandra.repair.messages.RepairMessage;
import org.apache.cassandra.service.ActiveRepairService;
import org.apache.cassandra.utils.concurrent.ImmediateFuture;

import static org.apache.cassandra.utils.Clock.Global.currentTimeMillis;

@@ -298,15 +299,15 @@ public Future<CoordinatedRepairResult> execute(Supplier<Future<CoordinatedRepair
});

// if any session failed, then fail the future
Future<CoordinatedRepairResult> onlySuccessSessionResults = repairSessionResults.map(result -> {
Future<CoordinatedRepairResult> onlySuccessSessionResults = repairSessionResults.flatMap(result -> {
finalizeStart = currentTimeMillis();
if (result.hasFailed())
{
if (logger.isDebugEnabled())
logger.debug("Incremental repair {} validation/stream phase completed in {}", sessionID, formatDuration(repairStart, finalizeStart));
throw SomeRepairFailedException.INSTANCE;
return ImmediateFuture.failure(SomeRepairFailedException.INSTANCE);
}
return result;
return ImmediateFuture.success(result);
});

// mark propose finalization and commit
@@ -129,6 +129,10 @@ public void testRemoteSyncFailure() throws Exception
assertEquals(0, parents.intValue());
Integer sessions = cluster.get(1).callOnInstance(() -> ActiveRepairService.instance.sessionCount());
assertEquals(0, sessions.intValue());

cluster.forEach(i -> Assertions.assertThat(i.logs().grep("SomeRepairFailedException").getResult())
.describedAs("node%d logged hidden exception org.apache.cassandra.repair.SomeRepairFailedException", i.config().num())
.isEmpty());
}
}

0 comments on commit 89fbb1a

Please sign in to comment.