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

Add MultiWriterIdGenerator. #7281

Merged
merged 6 commits into from
May 4, 2020
Merged

Conversation

erikjohnston
Copy link
Member

@erikjohnston erikjohnston commented Apr 15, 2020

This will be used to coordinate stream IDs across multiple writers, though is currently unused. Only works with Postgres.

Functions as the equivalent of both StreamIdGenerator and SlavedIdTracker.

(This is an implementation of what is talked about in the design doc: https://docs.google.com/document/d/1xL1foUsHgcHdVTOAMSJIST04cH0ukHd-oCKFw3m9sxY/edit?usp=sharing )

@erikjohnston erikjohnston force-pushed the erikj/multi_writer_id_generator branch 2 times, most recently from 38bd8ca to ea8359b Compare April 16, 2020 09:43
This will be used to coordinate stream IDs across multiple writers.

Functions as the equivalent of both `StreamIdGenerator` and
`SlavedIdTracker`.
@erikjohnston erikjohnston force-pushed the erikj/multi_writer_id_generator branch from ea8359b to b52251a Compare May 1, 2020 16:02
@erikjohnston erikjohnston requested a review from a team May 1, 2020 16:07
@clokep clokep self-assigned this May 1, 2020
@clokep
Copy link
Member

clokep commented May 1, 2020

Only works with Postgres.

Is worker mode even supported with sqlite?

@erikjohnston
Copy link
Member Author

Only works with Postgres.

Is worker mode even supported with sqlite?

It is not :)

Copy link
Member

@clokep clokep left a comment

Choose a reason for hiding this comment

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

Generally the logic makes sense, although I'm having some trouble visualizing how it will be used in practice. I left a few minor comments which can be summarized as "please leave some comments" 😄

changelog.d/7281.misc Outdated Show resolved Hide resolved
synapse/storage/util/id_generators.py Outdated Show resolved Hide resolved
tests/storage/test_id_generators.py Show resolved Hide resolved
synapse/storage/util/id_generators.py Outdated Show resolved Hide resolved
synapse/storage/util/id_generators.py Outdated Show resolved Hide resolved
tests/storage/test_id_generators.py Outdated Show resolved Hide resolved
@erikjohnston erikjohnston requested a review from clokep May 4, 2020 14:25
Copy link
Member

@clokep clokep left a comment

Choose a reason for hiding this comment

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

Looks good, assuming CI passes!

@erikjohnston erikjohnston merged commit 8123b2f into develop May 4, 2020
@erikjohnston erikjohnston deleted the erikj/multi_writer_id_generator branch May 4, 2020 16:17
phil-flex pushed a commit to phil-flex/synapse that referenced this pull request Jun 16, 2020
This will be used to coordinate stream IDs across multiple writers.

Functions as the equivalent of both `StreamIdGenerator` and
`SlavedIdTracker`.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants