summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorAndrew Morgan <1342360+anoadragon453@users.noreply.github.com>2019-11-06 17:21:20 +0000
committerGitHub <noreply@github.com>2019-11-06 17:21:20 +0000
commita6ebef1bfd322f3ac2a6393388f0eda9fa476047 (patch)
treefb4011dabf8ab2a1eef741dca71d22829c060ee6 /synapse/storage
parentMerge branch 'master' into develop (diff)
parentraise exception after multiple failures (diff)
downloadsynapse-a6ebef1bfd322f3ac2a6393388f0eda9fa476047.tar.xz
Make numeric user_id checker start at @0, and don't ratelimit on checking (#6338)
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/data_stores/main/registration.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/synapse/storage/data_stores/main/registration.py b/synapse/storage/data_stores/main/registration.py
index f70d41ecab..ee1b2b2bbf 100644
--- a/synapse/storage/data_stores/main/registration.py
+++ b/synapse/storage/data_stores/main/registration.py
@@ -488,14 +488,14 @@ class RegistrationWorkerStore(SQLBaseStore):
         we can. Unfortunately, it's possible some of them are already taken by
         existing users, and there may be gaps in the already taken range. This
         function returns the start of the first allocatable gap. This is to
-        avoid the case of ID 10000000 being pre-allocated, so us wasting the
-        first (and shortest) many generated user IDs.
+        avoid the case of ID 1000 being pre-allocated and starting at 1001 while
+        0-999 are available.
         """
 
         def _find_next_generated_user_id(txn):
-            # We bound between '@1' and '@a' to avoid pulling the entire table
+            # We bound between '@0' and '@a' to avoid pulling the entire table
             # out.
-            txn.execute("SELECT name FROM users WHERE '@1' <= name AND name < '@a'")
+            txn.execute("SELECT name FROM users WHERE '@0' <= name AND name < '@a'")
 
             regex = re.compile(r"^@(\d+):")