mirror of
https://github.com/element-hq/synapse.git
synced 2026-11-04 13:28:04 +00:00
The rooms row for a new room is inserted by the persist transaction, Rust or Python, when the create event's context is flagged, instead of by a store_room transaction of its own beforehand. The insert also claims the room ID: a row already there fails the batch with RoomIdCollisionError, and create_room runs the whole creation again under a fresh ID, perturbing the create event's timestamp for v12+ rooms as the old loop did. The room version is prefilled on the upgrade path too, as the row is no longer there to read. The chain cover check skips its rooms read when the create event is among the events, since the row may not be stored yet, and the createRoom bench advances the fake clock per room so that rooms do not collide.