belliottsmith commented on code in PR #2144:
URL: https://github.com/apache/cassandra/pull/2144#discussion_r1128748652


##########
src/java/org/apache/cassandra/service/accord/AccordStateCache.java:
##########
@@ -149,17 +145,12 @@ public NamedMap(String name)
         }
     }
 
-    public final Map<Object, Node<?, ?>> active = new HashMap<>();
     private final Map<Object, Node<?, ?>> cache = new HashMap<>();
-    private final Map<Object, WriteOnlyGroup<?, ?>> pendingWriteOnly = new 
HashMap<>();
-    private final Set<Instance<?, ?>> instances = new HashSet<>();
-
-    private final NamedMap<Object, Future<?>> loadFutures = new 
NamedMap<>("loadFutures");
-    private final NamedMap<Object, Future<?>> saveFutures = new 
NamedMap<>("saveFutures");
+    private final Set<Instance<?, ?, ?>> instances = new HashSet<>();
 
-    private final NamedMap<Object, Future<Data>> readFutures = new 
NamedMap<>("readFutures");
-    private final NamedMap<Object, Future<?>> writeFutures = new 
NamedMap<>("writeFutures");
+    private final NamedMap<Object, AsyncResult<Void>> saveResults = new 
NamedMap<>("saveResults");
 
+    private int linked = 0;

Review Comment:
   Once a minute is definitely not enough. You do not need much traffic to 
exhaust the cache in that time interval. Let's say you have 128MiB cache, 5k 
qps, you only 450 bytes in cache per query to exhaust the cache. Just 50 bytes 
per query wastes 10% of your cache space.
   
   I'm strongly -1 on timed cache clearing. Cache management should dynamic 
based on actual demand and conditions. If we decide to accept the pointer 
chasing cost that's one thing, but a cache clearance frequency is another 
tunable we _shouldn't_ have, and we have enough of those.
   
   I don't mind punting on this, with a `TODO (expected)` to revisit, perhaps 
when we address persistence. But not with a periodic clearance, let's keep 
doing this on demand.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to