File tree Expand file tree Collapse file tree 4 files changed +22
-9
lines changed
src/java/org/apache/cassandra
test/distributed/org/apache/cassandra/distributed/test/log Expand file tree Collapse file tree 4 files changed +22
-9
lines changed Original file line number Diff line number Diff line change 115.1
2+ * Fix issue when running cms reconfiguration with paxos repair disabled (CASSANDRA-20869)
23 * Added additional parameter to JVM shutdown to allow for logs to be properly shutdown (CASSANDRA-20978)
34 * Improve isGossipOnlyMember and location lookup performance (CASSANDRA-21039)
45 * Refactor the way we check if a transformation is allowed to be committed during upgrades (CASSANDRA-21043)
Original file line number Diff line number Diff line change 2020import java .io .IOException ;
2121import java .net .UnknownHostException ;
2222import java .util .ArrayList ;
23- import java .util .Arrays ;
2423import java .util .Collection ;
2524import java .util .Collections ;
2625import java .util .HashMap ;
118117import org .apache .cassandra .utils .concurrent .AsyncPromise ;
119118import org .apache .cassandra .utils .concurrent .Future ;
120119import org .apache .cassandra .utils .concurrent .FutureCombiner ;
121- import org .apache .cassandra .utils .concurrent .ImmediateFuture ;
122120
123121import static com .google .common .collect .Iterables .concat ;
124122import static com .google .common .collect .Iterables .transform ;
@@ -1190,13 +1188,13 @@ public List<Supplier<Future<?>>> repairPaxosForTopologyChangeAsync(String ksName
11901188 if (!paxosRepairEnabled ())
11911189 {
11921190 logger .warn ("Not running paxos repair for topology change because paxos repair has been disabled" );
1193- return Arrays . asList (() -> ImmediateFuture . success ( null ) );
1191+ return Collections . emptyList ( );
11941192 }
11951193
11961194 if (ranges .isEmpty ())
11971195 {
11981196 logger .warn ("Not running paxos repair for topology change because there are no ranges to repair" );
1199- return Arrays . asList (() -> ImmediateFuture . success ( null ) );
1197+ return Collections . emptyList ( );
12001198 }
12011199 ClusterMetadata metadata = ClusterMetadata .current ();
12021200 List <TableMetadata > tables = Lists .newArrayList (metadata .schema .getKeyspaces ().getNullable (ksName ).tables );
Original file line number Diff line number Diff line change 3030import java .util .function .Supplier ;
3131
3232import com .google .common .collect .ImmutableSet ;
33+ import com .google .common .collect .Lists ;
3334import org .slf4j .Logger ;
3435import org .slf4j .LoggerFactory ;
3536
@@ -198,7 +199,7 @@ public SequenceState executeNext()
198199 {
199200 String message = "Some data streaming failed. Use nodetool to check CMS reconfiguration state and resume. " +
200201 "For more, see `nodetool help cms reconfigure`." ;
201- logger .warn (message );
202+ logger .warn (message , t );
202203 return SequenceState .error (new RuntimeException (message ));
203204 }
204205 }
@@ -344,10 +345,10 @@ static void repairPaxosForCMSTopologyChange()
344345 // overlapping quorums invariant holds.
345346
346347 Retry retry = Retry .withNoTimeLimit (TCMMetrics .instance .repairPaxosTopologyRetries );
347- List <Supplier <Future <?>>> remaining = ActiveRepairService .instance ()
348- .repairPaxosForTopologyChangeAsync (SchemaConstants .METADATA_KEYSPACE_NAME ,
349- Collections .singletonList (entireRange ),
350- "CMS reconfiguration" );
348+ List <Supplier <Future <?>>> remaining = Lists . newArrayList ( ActiveRepairService .instance ()
349+ .repairPaxosForTopologyChangeAsync (SchemaConstants .METADATA_KEYSPACE_NAME ,
350+ Collections .singletonList (entireRange ),
351+ "CMS reconfiguration" ) );
351352
352353 while (true )
353354 {
Original file line number Diff line number Diff line change @@ -308,6 +308,19 @@ public void cmsTopologyChangePaxosTest() throws Throwable
308308 }
309309 }
310310
311+ @ Test
312+ public void testReconfigurePaxosRepairDisabled () throws IOException
313+ {
314+ try (Cluster cluster = builder ().withNodes (3 )
315+ .withConfig (c -> c .with (Feature .NETWORK )
316+ .set ("paxos_repair_enabled" , "false" ))
317+ .withoutVNodes ()
318+ .start ())
319+ {
320+ cluster .get (1 ).nodetoolResult ("cms" , "reconfigure" , "3" ).asserts ().success ();
321+ }
322+ }
323+
311324 private PaxosRepairHistory paxosRepairHistory (IInvokableInstance instance )
312325 {
313326 Object [][] rows = instance .executeInternal ("select points from system.paxos_repair_history " +
You can’t perform that action at this time.
0 commit comments