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/25 12:21:53 UTC

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

jacek-lewandowski commented on a change in pull request #1168:
URL: https://github.com/apache/cassandra/pull/1168#discussion_r756842833



##########
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'm not sure about that, but I was wondering whether we should update the version after replaying the commit log? I justify my question by the fact that schema and its version is read before replaying the commit log, if there are mutations replayed, the versions is likely to change - by recalculating it, we may avoid unnecessary syncing schema with other nodes - does it make sense?




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