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

lxd/cluster: Fix schema upgrades #5379

Merged
merged 1 commit into from Dec 23, 2018

Conversation

2 participants
@stgraber
Copy link
Member

stgraber commented Dec 22, 2018

While working on LXD 3.0 deb to LXD 3.8 snap upgrades, I ran into an
issue where loading the prepared statements was erroring out, causing
the daemon to exit.

That happens when the first node upgrades as the rest of the cluster is
still on the older schema version, causing the schema upgrade code to be
skipped. The prepared statements were then loaded regardless, causing
the crash when preparing them.

Instead, as soon as we know that the DB hasn't been upgraded, return and
let the retry logic happen. Once the remaining nodes have upgraded, the
schema update will happen and the prepared statements will be
re-processed.

Signed-off-by: Stéphane Graber stgraber@ubuntu.com

lxd/cluster: Fix schema upgrades
While working on LXD 3.0 deb to LXD 3.8 snap upgrades, I ran into an
issue where loading the prepared statements was erroring out, causing
the daemon to exit.

That happens when the first node upgrades as the rest of the cluster is
still on the older schema version, causing the schema upgrade code to be
skipped. The prepared statements were then loaded regardless, causing
the crash when preparing them.

Instead, as soon as we know that the DB hasn't been upgraded, return and
let the retry logic happen. Once the remaining nodes have upgraded, the
schema update will happen and the prepared statements will be
re-processed.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
@freeekanayaka

This comment has been minimized.

Copy link
Member

freeekanayaka commented Dec 23, 2018

Good catch.

@freeekanayaka freeekanayaka merged commit b76e5e8 into lxc:master Dec 23, 2018

4 of 5 checks passed

Testsuite Testsuite failed
Details
Branch target Branch target is correct
Details
DCO All commits signed-off
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment