-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Foundation of new syn2mas tool #3636
base: rei/target_syn2mas
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks very promising! I've left a bunch of feedback after a first read; I still want to look at the constraint save/restoration in more details later
/// If you want to use this tool anyway, please pass this argument. | ||
/// | ||
/// If you want to migrate from Synapse to MAS today, please use the Node.js-based tool in the MAS repository. | ||
#[clap(long = "i-swear-i-am-just-testing-in-a-staging-environment")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🫡
const NUM_WRITER_CONNECTIONS: usize = 8; | ||
|
||
impl Options { | ||
pub async fn run(self, figment: &Figment) -> anyhow::Result<ExitCode> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally, I would appreciate tracing spans on most operations, which would help a lot diagnose what takes time, but that can be introduced later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah I still need to figure out tracing (in the sense of spans) to be honest. Can probably just add #[instrument]
s without too much hassle though...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can always add more infos or better names on them later, but this is fine 👍
Deploying matrix-authentication-service-docs with Cloudflare Pages
|
fb1d512
to
64f5c65
Compare
const NUM_WRITER_CONNECTIONS: usize = 8; | ||
|
||
impl Options { | ||
pub async fn run(self, figment: &Figment) -> anyhow::Result<ExitCode> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can always add more infos or better names on them later, but this is fine 👍
crates/syn2mas/src/mas_writer.rs
Outdated
connection_rx: Receiver<Result<PgConnection, Error>>, | ||
|
||
/// A sender handle to return a writer connection to the pool | ||
/// The connection should still be mid-transaction! | ||
connection_tx: Sender<Result<PgConnection, Error>>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. The transaction either olds a ref to a connection or a connection from a pool. Weird that there is no good way to have an owned connection in there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks less scary after looking at it again
This is the start of a new version of the syn2mas tool.
Given it's missing a lot of stuff still, I'm intending to merge this to an intermediary branch where I can then build upon this with the missing features.
Notable inclusions
Notable missing features (for later PRs)
Performance
This currently runs a synthetic matrix.org-size migration under 15 seconds. (Bear in mind this is only one part of the migration, but it gives a rough idea of where we're going with this.)
The synthetic database was set up with the same number of real users as matrix.org, but guest and appservice users were not populated in the database so in reality this may run slower because the Synapse Postgres instance will need to read and skip rows corresponding to guests and appservice users.