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

[GitHub] [cassandra] krummas commented on a change in pull request #1290: [CASSANDRA-14898] Fix performance issue of keycache not loading fast.

krummas commented on a change in pull request #1290:
URL: https://github.com/apache/cassandra/pull/1290#discussion_r763002911



##########
File path: src/java/org/apache/cassandra/service/CacheService.java
##########
@@ -472,7 +482,23 @@ public void serialize(KeyCacheKey key, DataOutputPlus out, ColumnFamilyStore cfs
             int generation = input.readInt();
             input.readBoolean(); // backwards compatibility for "promoted indexes" boolean
             SSTableReader reader = null;
-            if (cfs == null || !cfs.isKeyCacheEnabled() || (reader = findDesc(generation, cfs.getSSTables(SSTableSet.CANONICAL))) == null)
+            if (!skipEntry)
+            {
+                Pair<String, String> qualifiedName = Pair.create(cfs.metadata.ksName, cfs.metadata.cfName);
+                Map<Integer, SSTableReader> generationToSSTableReader = cachedSSTableReaders.get(qualifiedName);
+                if (generationToSSTableReader == null)
+                {
+                    generationToSSTableReader = cfs.collect(SSTableSet.CANONICAL,

Review comment:
       could we just build the map here? Don't see a need for the new collect(...) method beyond this
   
   if we want to keep the method there should probably be tests for it as well

##########
File path: conf/cassandra.yaml
##########
@@ -286,7 +286,11 @@ counter_cache_save_period: 7200
 # If not set, the default directory is $CASSANDRA_HOME/data/saved_caches.
 # saved_caches_directory: /var/lib/cassandra/saved_caches
 
-# commitlog_sync may be either "periodic" or "batch." 
+# Max amount of time in seconds server has wait for cache to load while starting the Cassandra process.
+# Cache will not load (during startup) if this value is negative as there is no time left to load.
+# max_cache_load_time: 30

Review comment:
       maybe name this `max_cache_load_time_seconds` to make it clearer




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