smiklosovic commented on code in PR #4535:
URL: https://github.com/apache/cassandra/pull/4535#discussion_r2634890640


##########
src/java/org/apache/cassandra/db/compression/CompressionDictionaryCache.java:
##########
@@ -102,7 +103,14 @@ public void add(@Nullable CompressionDictionary 
compressionDictionary)
 
         // Only update cache if not already in the cache
         DictId newDictId = compressionDictionary.dictId();
-        cache.get(newDictId, id -> compressionDictionary);
+        cache.get(newDictId, id -> {
+            Ref<?> ref = compressionDictionary.tryRef();

Review Comment:
   the reason this is happening is that we actually do not need to call 
`tryRef` here. Previously, when we came to this place, the state of it was that 
it had Ref created in `ZstdCompressionDictionary` _constructor_. But now, to be 
on par, `tryRef` is doing two things: first it lazily initializes Ref and 
_then_ it will call `tryRef` on that. We do not need to call `tryRef`. If we 
just initialize ref, that is just enough and doing so will make the test I talk 
below pass.



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