zulip/zerver/models
Alex Vandiver 7720d362ba messages: Only lock UserMessage rows, not other joined tables.
By default, `SELECT FOR UPDATE` will also lock any rows which are
`JOIN`ed into the selected rows; in the case of UserMessage rows, this
can mean arbitrary Message rows.

Since the messages themselves are not being changed, it is not
necessary to lock them -- and doing so may lead to deadlocks, in the
case that the UserMessage row is locked for update before the Message,
and some other request has already taken a read lock on the Message
and is blocked on the UserMessage write lock.

Change `select_for_update_query` to explicitly only lock UserMessage.
2024-01-09 13:13:59 -08:00
..
__init__.py models: Extract zerver.models.lookups. 2023-12-16 22:08:44 -08:00
alert_words.py models: Extract zerver.models.alert_words. 2023-12-16 22:08:44 -08:00
bots.py models: Extract zerver.models.bots. 2023-12-16 22:08:44 -08:00
clients.py models: Extract zerver.models.clients. 2023-12-16 22:08:44 -08:00
constants.py
custom_profile_fields.py models: Extract zerver.models.custom_profile_fields. 2023-12-16 22:08:44 -08:00
drafts.py models: Extract zerver.models.drafts. 2023-12-16 22:08:44 -08:00
groups.py models: Extract zerver.models.groups. 2023-12-16 22:08:44 -08:00
linkifiers.py models: Extract zerver.models.linkifiers. 2023-12-16 22:08:44 -08:00
lookups.py models: Extract zerver.models.lookups. 2023-12-16 22:08:44 -08:00
messages.py messages: Only lock UserMessage rows, not other joined tables. 2024-01-09 13:13:59 -08:00
muted_users.py models: Extract zerver.models.muted_users. 2023-12-16 22:08:44 -08:00
onboarding_steps.py models: Extract zerver.models.onboarding_steps. 2023-12-16 22:08:44 -08:00
prereg_users.py models: Extract zerver.models.prereg_users. 2023-12-16 22:08:44 -08:00
presence.py models: Extract zerver.models.presence. 2023-12-16 22:08:44 -08:00
push_notifications.py models: Extract zerver.models.push_notifications. 2023-12-16 22:08:44 -08:00
realm_audit_logs.py support: Add admin support for updating end date of active plan. 2024-01-09 10:13:21 -08:00
realm_emoji.py models: Extract zerver.models.realm_emoji. 2023-12-16 22:08:44 -08:00
realm_playgrounds.py models: Extract zerver.models.realm_playgrounds. 2023-12-16 22:08:44 -08:00
realms.py models: Extract zerver.models.realms. 2023-12-16 22:08:44 -08:00
recipients.py models: Extract zerver.models.recipients. 2023-12-16 22:08:44 -08:00
scheduled_jobs.py models: Extract zerver.models.scheduled_jobs. 2023-12-16 22:08:44 -08:00
streams.py models: Extract zerver.models.streams. 2023-12-16 22:08:44 -08:00
user_activity.py models: Extract zerver.models.user_activity. 2023-12-16 22:08:44 -08:00
user_topics.py models: Extract zerver.models.user_topics. 2023-12-16 22:08:44 -08:00
users.py models: Extract zerver.models.custom_profile_fields. 2023-12-16 22:08:44 -08:00