Introduction
The LXD team is very excited to announce the release of microcluster v2.2.0!
Microcluster is a Go library that simplifies development of dqlite clusters.
This release contains various bugfixes and improvements.
Improvements
Documentation
Detailed documentation has been added covering microcluster features and hooks, the core REST API, the upgrade process and more.
See Backport docs to v2 and update links by minaelee · Pull Request #368 · canonical/microcluster · GitHub for details.
Draining network connections
Microcluster must close and reopen network listeners during certain operations. Existing connections were abruptly closed, which caused EOF
errors in the client. This was fixed to allow listeners to keep existing connections alive until a configurable timeout is reached.
See Backport shutdown servers when resetting cluster membership (v2) by claudiubelu · Pull Request #309 · canonical/microcluster · GitHub and Backport implicit shutdown regression fix and DB project removal (v2) by roosterfish · Pull Request #366 · canonical/microcluster · GitHub for details.
Bugfixes
Cluster member join clean up
If a new cluster member failed to join the cluster, but the failure occurred after the cluster member was already added to the DQLite database, the new member was not removed from the database. This has been fixed.
See Backport return joinInfo even on error (v2) by claudiubelu · Pull Request #308 · canonical/microcluster · GitHub for details.
Exclude zone identifiers from IPv6 addresses during authentication
Authentication in Microcluster performs some logic against the request host. This logic did not account for IPv6 zone identifiers. This is fixed to remove the zone identifier from the address before authentication is performed.
See Backport fixes (v2) by roosterfish · Pull Request #348 · canonical/microcluster · GitHub for details.
Incorrect database state on restart
When a microcluster member was restarted, the initial database status was always set to DatabaseNotReady
. This is fixed to determine and set the database status after initialisation.
See Backport: internal/db: Set database status based on initialization state by bschimke95 · Pull Request #320 · canonical/microcluster · GitHub for details.
State handling on cluster join
When joining a cluster fails, the joining member is reset to clear any leftover state. In some cases, the reset operation was performed more than once, causing race conditions and state corruption. This was fixed to prevent certain operations from being performed more than once.
See Cluster: Various fixes for errors on join by roosterfish · Pull Request #386 · canonical/microcluster · GitHub for details.
Deprecations
Removal of project namespacing in SQL statement preparation
Microcluster expects users to call a function to prepare their SQL statements. This function accepts a project
argument. It has been determined that project namespacing is not required, which has allowed us to deprecate the problematic function GetCallerProject
, which caused issues with vendored dependencies (see Cannot initialize Microcluster if it is used as a vendored dependency · Issue #350 · canonical/microcluster · GitHub). The project
argument used when preparing statements is retained for backwards compatibility.
See Backport implicit shutdown regression fix and DB project removal (v2) by roosterfish · Pull Request #366 · canonical/microcluster · GitHub for details.
Importing Microcluster v2.2.0
go get -u github.com/canonical/microcluster/v2
Or if you haven’t yet added Microcluster to your list of dependencies run
go get github.com/canonical/microcluster/v2@latest