summary refs log tree commit diff
path: root/synapse/storage/databases/main/registration.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2020-09-28 18:00:30 +0100
committerGitHub <noreply@github.com>2020-09-28 18:00:30 +0100
commitbd380d942fdf91cf1214d6859f2bc97d12a92ab4 (patch)
tree515186a89d274f7d4272f4cdcb0e9698dac7e2ef /synapse/storage/databases/main/registration.py
parentCreate a mechanism for marking tests "logcontext clean" (#8399) (diff)
downloadsynapse-bd380d942fdf91cf1214d6859f2bc97d12a92ab4.tar.xz
Add checks for postgres sequence consistency (#8402)
Diffstat (limited to 'synapse/storage/databases/main/registration.py')
-rw-r--r--synapse/storage/databases/main/registration.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/synapse/storage/databases/main/registration.py b/synapse/storage/databases/main/registration.py
index 48ce7ecd16..a83df7759d 100644
--- a/synapse/storage/databases/main/registration.py
+++ b/synapse/storage/databases/main/registration.py
@@ -41,6 +41,9 @@ class RegistrationWorkerStore(SQLBaseStore):
         self.config = hs.config
         self.clock = hs.get_clock()
 
+        # Note: we don't check this sequence for consistency as we'd have to
+        # call `find_max_generated_user_id_localpart` each time, which is
+        # expensive if there are many entries.
         self._user_id_seq = build_sequence_generator(
             database.engine, find_max_generated_user_id_localpart, "user_id_seq",
         )