Skip to content

Fix portdb missing un_partial_stated_room_stream_sequence setup - #20302

Merged
anoadragon453 merged 4 commits into
element-hq:developfrom
bunnysayzz:fix/portdb-room-stream-sequence
Oct 7, 2026
Merged

anoadragon453 merged 4 commits into
element-hq:developfrom
bunnysayzz:fix/portdb-room-stream-sequence

Conversation

@bunnysayzz

@bunnysayzz bunnysayzz commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #20277.

synapse_port_db.py Step 2 set up un_partial_stated_event_stream_sequence but never un_partial_stated_room_stream_sequence, even though room.py reads that sequence for the un_partial_stated_room_stream. After a sqlite to postgres port, MultiWriterIdGenerator compares the sequence last_value against MAX(stream_id) in stream_positions (sequence.py) and fails with the sequence inconsistent error from the issue.

This adds the missing _setup_sequence call next to the event-stream one, same (table, column) tuple pattern. py_compile clean on the edited script. Could not run the portdb script end to end here (needs live sqlite and postgres), so this is code-verified only.

@bunnysayzz
bunnysayzz requested a review from a team as a code owner October 1, 2026 22:49
@bunnysayzz
bunnysayzz requested review from anoadragon453 and removed request for a team October 1, 2026 22:49
@CLAassistant

CLAassistant commented Oct 1, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@anoadragon453 anoadragon453 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this!

Comment thread changelog.d/20302.bugfix Resolved
@anoadragon453
anoadragon453 merged commit 2392446 into element-hq:develop Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Database A-Portdb `synapse_port_db`

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Postgres sequence un_partial_stated_room_stream_sequence is inconsistent with associated stream position

4 participants