summary refs log tree commit diff
diff options
context:
space:
mode:
authorAzrenbeth <7782548+Azrenbeth@users.noreply.github.com>2021-09-27 15:14:36 +0100
committerAzrenbeth <7782548+Azrenbeth@users.noreply.github.com>2021-09-27 15:14:36 +0100
commit71aace8a0d1db6e4c742c217687c94941bb75844 (patch)
tree55e3d78066ba8f6c3fc2e54b6590f6fae463ecad
parentExtract dsn parameters earlier (diff)
downloadsynapse-71aace8a0d1db6e4c742c217687c94941bb75844.tar.xz
Move from compressing largest rooms to compressing number of chunks
-rw-r--r--docs/sample_config.yaml4
-rw-r--r--synapse/config/state_compressor.py6
-rw-r--r--synapse/util/state_compressor.py4
3 files changed, 7 insertions, 7 deletions
diff --git a/docs/sample_config.yaml b/docs/sample_config.yaml
index 947eea3400..aa9c5f3090 100644
--- a/docs/sample_config.yaml
+++ b/docs/sample_config.yaml
@@ -2667,9 +2667,9 @@ state_compressor:
   #
   #chunk_size: 1000
 
-  # The number of rooms to compress on each run. Defaults to 5.
+  # The number of chunks to compress on each run. Defaults to 50.
   #
-  #number_of_rooms: 1
+  #number_of_chunks: 1
 
   # The default level sizes for the compressor to use. Defaults to
   # 100,50,25.
diff --git a/synapse/config/state_compressor.py b/synapse/config/state_compressor.py
index d9c1b7e46a..40390fbf52 100644
--- a/synapse/config/state_compressor.py
+++ b/synapse/config/state_compressor.py
@@ -36,7 +36,7 @@ class StateCompressorConfig(Config):
             raise ConfigError from e
 
         self.compressor_chunk_size = compressor_config.get("chunk_size") or 500
-        self.compressor_number_of_rooms = compressor_config.get("number_of_rooms") or 5
+        self.compressor_number_of_chunks = compressor_config.get("number_of_chunks") or 50
         self.compressor_default_levels = (
             compressor_config.get("default_levels") or "100,50,25"
         )
@@ -67,9 +67,9 @@ class StateCompressorConfig(Config):
           #
           #chunk_size: 1000
 
-          # The number of rooms to compress on each run. Defaults to 5.
+          # The number of chunks to compress on each run. Defaults to 50.
           #
-          #number_of_rooms: 1
+          #number_of_chunks: 1
 
           # The default level sizes for the compressor to use. Defaults to
           # 100,50,25.
diff --git a/synapse/util/state_compressor.py b/synapse/util/state_compressor.py
index 7239554d48..2f85fb7ea3 100644
--- a/synapse/util/state_compressor.py
+++ b/synapse/util/state_compressor.py
@@ -89,11 +89,11 @@ def setup_state_compressor(hs: "HomeServer"):
             desc="State Compressor",
             func=defer_to_thread,
             reactor=hs.get_reactor(),
-            f=state_compressor.compress_largest_rooms,
+            f=state_compressor.compress_state_events_table,
             db_url=db_url,
             chunk_size=compressor_config.compressor_chunk_size,
             default_levels=compressor_config.compressor_default_levels,
-            number_of_rooms=compressor_config.compressor_number_of_rooms,
+            number_of_chunks=compressor_config.compressor_number_of_chunks,
         )
 
     # Call the compressor every `time_between_runs` milliseconds