summary refs log tree commit diff
path: root/synapse/storage/search.py
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2018-02-02 14:32:51 +0000
committerRichard van der Hoff <richard@matrix.org>2018-02-02 14:32:51 +0000
commit6b02fc80d173d3d4de81623d411a136abe1637e9 (patch)
treebe205b82531cde6154a4f20ee84923282f595e83 /synapse/storage/search.py
parentfix GIST->GIN switch (diff)
downloadsynapse-6b02fc80d173d3d4de81623d411a136abe1637e9.tar.xz
Reinstate event_search_postgres_gist handler
People may have queued updates for this, so we can't just delete it.
Diffstat (limited to 'synapse/storage/search.py')
-rw-r--r--synapse/storage/search.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/synapse/storage/search.py b/synapse/storage/search.py
index d3e76b58d6..13c827cf87 100644
--- a/synapse/storage/search.py
+++ b/synapse/storage/search.py
@@ -31,6 +31,7 @@ class SearchStore(BackgroundUpdateStore):
 
     EVENT_SEARCH_UPDATE_NAME = "event_search"
     EVENT_SEARCH_ORDER_UPDATE_NAME = "event_search_order"
+    EVENT_SEARCH_USE_GIST_POSTGRES_NAME = "event_search_postgres_gist"
     EVENT_SEARCH_USE_GIN_POSTGRES_NAME = "event_search_postgres_gin"
 
     def __init__(self, db_conn, hs):
@@ -42,6 +43,16 @@ class SearchStore(BackgroundUpdateStore):
             self.EVENT_SEARCH_ORDER_UPDATE_NAME,
             self._background_reindex_search_order
         )
+
+        # we used to have a background update to turn the GIN index into a
+        # GIST one; we no longer do that (obviously) because we actually want
+        # a GIN index. However, it's possible that some people might still have
+        # the background update queued, so we register a handler to clear the
+        # background update.
+        self.register_noop_background_update(
+            self.EVENT_SEARCH_USE_GIST_POSTGRES_NAME,
+        )
+
         self.register_background_update_handler(
             self.EVENT_SEARCH_USE_GIN_POSTGRES_NAME,
             self._background_reindex_gin_search