Comments (4)
The way we do it in LXD is that all servers check a table that will never have its schema changed. That table includes the current schema version for each server in the cluster.
On startup servers update their schema version number in that table and then will wait until all servers are reporting the same schema version.
The leader then has a slight variation to that which is that it will wait for all servers except itself to report the new version, then will apply the schema update and update its own record.
This in turn causes all the other servers to notice that all servers are ready and have them complete startup.
With that, you end up with a database that keeps functioning on the older daemons until they're all restarted.
from dqlite.
Thank you for the reply @stgraber. Do you use snap epochs (or any other mechanism) so as to ensure users do not jump (upgrade or downgrade) to a snap track/revision that does not know how to migrate the current schema to the one it knows of?
from dqlite.
No, LXD generally doesn't remove support for older releases.
We did do one break with 5.0 but didn't end up using epochs as we had some issues with them at the time. 4.0 is now the oldest that can upgrade to 5.0, but you can otherwise go from 0.1 straight to 4.0 and then to 5.13 and LXD will handle it just fine.
from dqlite.
The way we do it in LXD is that all servers check a table that will never have its schema changed. That table includes the current schema version for each server in the cluster.
On startup servers update their schema version number in that table and then will wait until all servers are reporting the same schema version.
The leader then has a slight variation to that which is that it will wait for all servers except itself to report the new version, then will apply the schema update and update its own record.
I don't really remember the details, but if we're speaking strictly about the database I think it doesn't need to be the leader that runs the schema upgrade, it can be whoever the first node is that notices that all other nodes have upgraded their version (i.e. the whole cluster is now running the same version). Since a schema upgrade is a SQL transaction, if 2 nodes race because they notice that the cluster is upgraded and they both try to upgrade the schema at the same time, then only one of them will succeed and the other will fail gracefully.
from dqlite.
Related Issues (20)
- Multi threading bug in tracef() HOT 1
- Jepsen: assertion failure in vfs.c HOT 1
- Nested barriers
- 1.16.0: test suite fails HOT 17
- Method to be informed about latest change in table HOT 2
- Several singular nodes joined later together HOT 2
- Run dqlite tests against most recent SQLite release. HOT 1
- Clarification on dqlite read operations HOT 1
- 1.16.2: build fails with raft 0.22.0 HOT 3
- Fix Coverity
- Use execinfo.h instead of libbacktrace HOT 3
- Set up tmate action
- Set up a canary PPA to get feedback from LP builders before merge HOT 2
- no known leader error forever
- Node.js bindings HOT 1
- Fix cases where the server can return a FAILURE message with result code 0
- Investigate what causes LXD's dqlite to create lots of singleton closed segments
- Flaky test: cluster/restart HOT 5
- 1.16.4: build fails on linking with missing `raft_register_state_cb` symbol HOT 1
- posix_fallocate extremely slow on ext3 file system HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dqlite.