You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by GitBox <gi...@apache.org> on 2022/04/07 18:25:03 UTC

[GitHub] [cassandra] dcapwell commented on a diff in pull request #1556: C175330 cleanup migration coord trunk

dcapwell commented on code in PR #1556:
URL: https://github.com/apache/cassandra/pull/1556#discussion_r845443459


##########
src/java/org/apache/cassandra/schema/MigrationCoordinator.java:
##########
@@ -90,15 +93,20 @@
     private static final Logger logger = LoggerFactory.getLogger(MigrationCoordinator.class);
     private static final Future<Void> FINISHED_FUTURE = ImmediateFuture.success(null);
 
+    private static LongSupplier getUptimeFn = () -> ManagementFactory.getRuntimeMXBean().getUptime();

Review Comment:
   this is dead code in your patch



##########
test/distributed/org/apache/cassandra/distributed/impl/Instance.java:
##########
@@ -631,6 +633,7 @@ public void startup(ICluster cluster)
                 StorageService.instance.registerDaemon(CassandraDaemon.getInstanceForTesting());
                 if (config.has(GOSSIP))
                 {
+                    MigrationCoordinator.setUptimeFn(() -> TimeUnit.NANOSECONDS.toMillis(nanoTime() - startedAt));

Review Comment:
   spoke in slack, can you also fix the startedAt bug?  This is object init, which != uptime.
   
   When we run for 1m and restart, the restart should have uptime=0 but will be uptime=1m due to the fact we don't cleanup the object.



##########
test/distributed/org/apache/cassandra/distributed/action/GossipHelper.java:
##########
@@ -228,7 +229,7 @@ public void accept(IInvokableInstance pullTo)
                 InetAddressAndPort endpoint = toCassandraInetAddressAndPort(pullFrom);
                 EndpointState state = Gossiper.instance.getEndpointStateForEndpoint(endpoint);
                 Gossiper.instance.doOnChangeNotifications(endpoint, ApplicationState.SCHEMA, state.getApplicationState(ApplicationState.SCHEMA));
-                Schema.instance.waitUntilReady(Duration.ofSeconds(10));
+                assertTrue("schema is ready", Schema.instance.waitUntilReady(Duration.ofSeconds(10)));

Review Comment:
   you are a good person here, but not in 4.0?  why the hate of 4.0!?!?!!



-- 
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: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org