Skip to content
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

db/cluster: Bump the value of sqlite_sequence for storage_volumes #7043

Merged

Conversation

@freeekanayaka
Copy link
Member

freeekanayaka commented Mar 17, 2020

Fixes #7024

Signed-off-by: Free Ekanayaka free.ekanayaka@canonical.com

Fixes #7024

Signed-off-by: Free Ekanayaka <free.ekanayaka@canonical.com>
@tomponline

This comment has been minimized.

Copy link
Member

tomponline commented Mar 17, 2020

@freeekanayaka do you know why the patch is needed, and the increment didn't happen normally? Could there be somewhere in the code that isn't incrementing it as needed?

Also, for my own information, do we use the sqlite_sequence table rather than an auto increment field because of the cluster replication?

@freeekanayaka

This comment has been minimized.

Copy link
Member Author

freeekanayaka commented Mar 17, 2020

@freeekanayaka do you know why the patch is needed, and the increment didn't happen normally?

I believe it's because during the last db upgrade we dropped and recreated the storage_volumes table and hence the sqlite_sequence table was reset to the maximum ID of the new storage_volumes table, which had less rows since we migrated snapshot rows to a separate table.

Could there be somewhere in the code that isn't incrementing it as needed?

Not afaics.

Also, for my own information, do we use the sqlite_sequence table rather than an auto increment field because of the cluster replication?

It's a compromise: ideally we'd use autoincrement (which basically mean a "private" table-specific counter in the sqlite_sequence table), but our internal code was very coupled with the fact that we had a single table for both volumes and snapshot, so as I first step I decided to share IDs. As we move forward we might be able to fix this and switch to autoincrement, the work that @monstermunchkin is doing seems to go into that direction.

@tomponline

This comment has been minimized.

Copy link
Member

tomponline commented Mar 17, 2020

@lxc-jenkins

This comment has been minimized.

Copy link

lxc-jenkins commented Mar 17, 2020

Testsuite passed

@tomponline tomponline merged commit 0f980fe into lxc:master Mar 17, 2020
5 checks passed
5 checks passed
Branch target Branch target is correct
Details
DCO All commits signed-off
Details
Testsuite Build finished.
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@YosuCadilla

This comment has been minimized.

Copy link

YosuCadilla commented Mar 17, 2020

Having similar issues as those mentioned in #7024 on a node with lots of snapshot usage.
Do you have a release date for 3.23?
Should I switch from stable to beta or just be patient?

@freeekanayaka freeekanayaka deleted the freeekanayaka:fix-sqlite-sequence-for-volumes branch Mar 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked issues

Successfully merging this pull request may close these issues.

4 participants
You can’t perform that action at this time.