Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Race condition with room creation means room directory lacks read-after-write consistency in monolith mode #15526

Open
MadLittleMods opened this issue May 3, 2023 · 0 comments
Labels
A-Create-Room A-Room-Directory S-Minor Blocks non-critical functionality, workarounds exist. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. X-Regression Something broke which worked on a previous release Z-Read-After-Write A lack of read-after-write consistency, usually due to cache invalidation races with workers

Comments

@MadLittleMods
Copy link
Contributor

MadLittleMods commented May 3, 2023

It's possible to query the room directory after the room creation and not see the room.

Reproduction steps

  1. Using monolith Synapse
  2. Create a public room called foo with /createRoom
  3. Immediately after seeing a successful create room response, search the room directory for the room (/publicRooms with { filter: { generic_search_term: 'foo' } })
  4. Notice that the room is missing from the response ❌

If you give the homeserver some time, the room will show up.

Notes

This regressed in #15229 where I guess the timing changed just enough for this to be possible. You can see the full bisect, investigation and context for how I noticed in matrix-org/matrix-viewer#208 (comment)

It seems like we're await'ing everywhere so not sure why this would happen. And seems weird that it would happen in monolith mode since there is not replication lag and we're awaiting everything.

@MadLittleMods MadLittleMods added A-Room-Directory A-Create-Room Z-Read-After-Write A lack of read-after-write consistency, usually due to cache invalidation races with workers X-Regression Something broke which worked on a previous release labels May 3, 2023
MadLittleMods added a commit to matrix-org/matrix-viewer that referenced this issue May 3, 2023
@DMRobertson DMRobertson added T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. S-Minor Blocks non-critical functionality, workarounds exist. labels May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Create-Room A-Room-Directory S-Minor Blocks non-critical functionality, workarounds exist. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. X-Regression Something broke which worked on a previous release Z-Read-After-Write A lack of read-after-write consistency, usually due to cache invalidation races with workers
Projects
None yet
Development

No branches or pull requests

2 participants