From 83dab3a106b8422eb461c844179d7bdd4f430391 Mon Sep 17 00:00:00 2001 From: Alexander Sayapin Date: Wed, 14 Jan 2026 11:50:58 +0700 Subject: [PATCH] fix: fix race condition while collection init - refs #ENOTE-932 --- syncstorage/storage/sql/queries_mysql.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/syncstorage/storage/sql/queries_mysql.py b/syncstorage/storage/sql/queries_mysql.py index e6d9174a..d0bb7f7d 100644 --- a/syncstorage/storage/sql/queries_mysql.py +++ b/syncstorage/storage/sql/queries_mysql.py @@ -8,6 +8,10 @@ tailored to MySQL. """ +INIT_COLLECTION = "INSERT IGNORE INTO user_collections "\ + "(userid, collection, last_modified) "\ + "VALUES (:userid, :collectionid, :modified)" + # MySQL's non-standard DELETE ORDER BY LIMIT is incredibly useful here. PURGE_SOME_EXPIRED_ITEMS = """