mozilla-services / syncserver

Run-Your-Own Firefox Sync Server
Mozilla Public License 2.0
1.87k stars 145 forks source link

Fix #246 Switch to syncstorage-rs, and document the additional depend… #248

Closed fzzzy closed 4 years ago

fzzzy commented 4 years ago

…encies required.

rfk commented 4 years ago

Sorry I didn't get a chance to check this out sooner.

What will the update experience be like here for existing users, particularly those following master (like https://github.com/mozilla-services/syncserver/issues/252)? IIUC this will require them to set up a fresh db using MySQL. It's also not clear to me what will happen if their existing config says to use a different db such as sqlite.

fzzzy commented 4 years ago

We're intending for old mysql databases to be compatible. If that's not the case we'll consider it a bug in syncstorage-rs.

Yes, you are right that old config options will not be supported. I have fleshed out plans for supporting old config options for the tokenserver in https://docs.google.com/document/d/10pwmjY1zMBzIdNpL3TV2FZXQLi2ste0Y2FQdcDyT4Ug/edit?ts=5f74fa2c#heading=h.lwwz96fhkfsv

If you wish, I can try my best to support old config options for the storage server. Let's file bugs for whatever we think needs supporting. Sqlite support isn't likely any time soon; could we just print an error message in those cases? However if someone does want to make a Sqlite backend, syncstorage-rs uses diesel for the mysql implementation which theoretically also supports sqlite, although I think there is a fair amount of plumbing.

rfk commented 4 years ago

Something else for us to consider here is users who are currently using a non-MySQL database for self-hosting, e.g. I believe the default setup is to use a sqlite db.

fzzzy commented 4 years ago

I think we'd like to retire the python code before we'll have a rust-based sqlite version. Would printing a deprecation message with a link to inquire if someone encounters that situation be enough? Then we could have whoever inquires because they actually do use a sqlite database test the (to-be-written) rust code that can transparently keep using that same sqlite db.

fzzzy commented 4 years ago

We could print a warning and fall back to the old python 2.7 code if someone is configured to use a sqlite database until the rust code is ready, actually. I think we should do that, as long as we anticipate the rust sqlite version being ready within the next 6 months, which I think is (? engineer estimate alert) reasonable.

fzzzy commented 4 years ago

I have investigated this more, and it makes sense and is easy to fall back to the python 2.7 implementation if we encounter an option that rust doesn't support. The responsibility is on the person using the configuration option that causes a python 2.7 fallback to make sure they have a working python 2.7 environment with all the right dependencies.