justinrsweeney commented on code in PR #1469:
URL: https://github.com/apache/solr/pull/1469#discussion_r1140330041


##########
solr/core/src/java/org/apache/solr/cloud/overseer/ZkStateWriter.java:
##########
@@ -286,7 +286,8 @@ public ClusterState writePendingUpdates(
           } else {
             byte[] data = Utils.toJSON(singletonMap(c.getName(), c));
             if (minStateByteLenForCompression > -1 && data.length > 
minStateByteLenForCompression) {
-              data = compressor.compressBytes(data);
+              // When compressing state.json, we expect at least a 10:1 
compression ratio.
+              data = compressor.compressBytes(data, data.length / 10);

Review Comment:
   Is this expectation based on a test? 
   
   The intention here was that by doing it as the same length and uncompressed 
data, we consume a bit more memory initially, but save on having to potentially 
resize the array. The ZLib docs seem to indicate an expected compression ratio 
of between 2:1 and 5:1. Would we be better off erring on the side of less 
compression and save resizing?



-- 
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: issues-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to