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 2021/11/29 13:12:06 UTC

[GitHub] [cassandra] adelapena commented on a change in pull request #1168: CASSANDRA-16878 trunk: Race in commit log replay can cause rejected mutations

adelapena commented on a change in pull request #1168:
URL: https://github.com/apache/cassandra/pull/1168#discussion_r758347304



##########
File path: src/java/org/apache/cassandra/schema/Schema.java
##########
@@ -606,11 +606,16 @@ public synchronized void clear()
      * in-memory representation got out of sync somehow with what's on disk.
      */
     public synchronized void reloadSchemaAndAnnounceVersion()
+    {
+        reloadSchema();
+        updateVersionAndAnnounce();
+    }
+
+    public synchronized void reloadSchema()
     {
         Keyspaces before = keyspaces.filter(k -> !SchemaConstants.isLocalSystemKeyspace(k.name));
         Keyspaces after = SchemaKeyspace.fetchNonSystemKeyspaces();
         merge(Keyspaces.diff(before, after));
-        updateVersionAndAnnounce();

Review comment:
       I think that the version is updated and announced by the call to `StorageService.initServer -> StorageService.prepareToJoin -> Schema.updateVersionAndAnnounce` that is done by `CassandraDaeamon#setup` [here](https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/service/CassandraDaemon.java#L417), after the commitlog has been replayed some lines above, [here](https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/service/CassandraDaemon.java#L357). So if I'm understanding it correctly the version is updated after replaying the commit log.




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