-
Notifications
You must be signed in to change notification settings - Fork 452
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
READY: Foreground DB upgrader #4480
Conversation
11c3a25
to
9160fd2
Compare
6420df6
to
dc89fb0
Compare
5767373
to
3334159
Compare
@ichorid don't forget to address this Pylint issue:
|
3334159
to
0d6adfe
Compare
That's intentional. This is Pony's way of plugging in code on DB startup. I've added a comment on this. |
This commit makes DB upgrader from 72 to 73(Pony) run in foreground (at the "spinning gears" screen). "Skip" button is shown on the screen during the upgrading process. A corresponding dialog window REST endpoint are added, too. To speed up the upgrade process, disk synchronization is disabled. This is safe since we don't touch the original database.
0d6adfe
to
89db424
Compare
from Tribler.Test.tools import trial_timeout | ||
|
||
|
||
class TestShutdownEndpoint(AbstractApiTest): |
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.
Please rename this endpoint and the docstring on the method test_upgrader_skip()
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.
Nice (end)point! 😉
89db424
to
52a27ba
Compare
52a27ba
to
8ccdda9
Compare
This PR moves 72 -> 73(Pony) upgrader out of the background thread to be run in the foreground at Tribler startup instead.
This greatly speed-ups the process by as we can use larger batches and disable disk synchronization during the upgrade process for the newly created DB. This is safe to do, since the old DB is read-only, and the conversion process can always be started from a clean slate if power fails during the upgrade process.
Disabling sync makes the upgrade process run on an HDD as fast as on an SSD. On my machine, a 400Mb
tribler.sdb
is converted in less than 1 minute.To give users some control over the process, a "skip" button along with a text indicator of the state of the upgrade process are added to the "spinning gears" screen. Pressing the button produces a confirmation dialog. Even if a user decides to skip the conversion process, their personal channel will still be converted.
Closes #4441
Closes #4439
Closes #4440