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

Dqlite v1.17.1 LTS, go-dqlite v2, Microcluster v2 & lxd, k8s-dqlite v1.3.0 #797

Merged
merged 7 commits into from
Dec 6, 2024

Conversation

louiseschmidtgen
Copy link
Contributor

@louiseschmidtgen louiseschmidtgen commented Nov 14, 2024

Dqlite v1.17.1 LTS, go-dqlite v2, Microcluster v2 & lxd, k8s-dqlite v1.3.0

Use the new Dqlite LTS v1.17.1 and go-dqlite v2.

Microcluster v2 (LTS) will have a fix backported for us (joining issues with names by enabling us to add extra sans). Consequently, the lxd version is adjusted to support v2 of microcluster.

This PR updates the k8s-dqlite version from v1.2.0 to v1.3.0 which uses Dqlite v1.17.1 LTS and go-dqlite v2.
Release notes: https://github.com/canonical/k8s-dqlite/releases/tag/v1.3.0

@louiseschmidtgen louiseschmidtgen requested a review from a team as a code owner November 14, 2024 09:37
Copy link
Contributor

@HomayoonAlimohammadi HomayoonAlimohammadi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @louiseschmidtgen! LGTM

.github/workflows/cron-jobs.yaml Show resolved Hide resolved
src/k8s/go.mod Outdated Show resolved Hide resolved
Copy link
Member

@berkayoz berkayoz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, left some comments

src/k8s/go.mod Outdated Show resolved Hide resolved
src/k8s/cmd/k8sd/k8sd_cluster_recover.go Outdated Show resolved Hide resolved
src/k8s/pkg/client/dqlite/client.go Outdated Show resolved Hide resolved
src/k8s/pkg/client/dqlite/types.go Outdated Show resolved Hide resolved
src/k8s/pkg/client/dqlite/util_test.go Outdated Show resolved Hide resolved
src/k8s/go.mod Outdated Show resolved Hide resolved
Copy link
Contributor

@bschimke95 bschimke95 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to wait and be updated once canonical/microcluster#290 is released (beginning of December).
This basically means we don't need microcluster v3 anymore but can pin the v2 LTS

@louiseschmidtgen louiseschmidtgen marked this pull request as draft November 26, 2024 16:22
@louiseschmidtgen louiseschmidtgen changed the title Bump go-dqlite v3 and dqlite v1.17.1 LTS & deps (lxd, mc) Bump go-dqlite v2 and dqlite v1.17.1 LTS once Microcluster v2 with fix is available Nov 26, 2024
@louiseschmidtgen louiseschmidtgen changed the title Bump go-dqlite v2 and dqlite v1.17.1 LTS once Microcluster v2 with fix is available Bump Dqlite v1.17.1 LTS, go-dqlite v2, Microcluster v2, k8s-dqlite v1.3.0 Nov 27, 2024
@louiseschmidtgen louiseschmidtgen changed the title Bump Dqlite v1.17.1 LTS, go-dqlite v2, Microcluster v2, k8s-dqlite v1.3.0 Dqlite v1.17.1 LTS, go-dqlite v2, Microcluster v2 & lxd, k8s-dqlite v1.3.0 Nov 27, 2024
src/k8s/go.mod Outdated Show resolved Hide resolved
@@ -31,8 +31,12 @@ func (e *Endpoints) postClusterBootstrap(_ state.State, r *http.Request) respons
}

// Check if the cluster is already bootstrapped
_, err = e.provider.MicroCluster().Status(r.Context())
if err == nil {
status, err := e.provider.MicroCluster().Status(r.Context())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We had a bug in main here:

_, err = e.provider.MicroCluster().Status(r.Context())

That version uses microcluster v3. This version contained a bug that was fixed in a later version
We silenced that issue here:
// Check if the cluster is already bootstrapped
_, err = e.provider.MicroCluster().Status(r.Context())

Instead of checking for the error we need to check for status.ready from that function.

Interestingly, this issue popped now up in v2 because the bugfix was backported with https://github.com/canonical/microcluster/pull/265/files and therefore no error was thrown anymore, causing the cluster falsely to claim that it is already bootstrapped.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great find @bschimke95! Thanks for resolving this bug.

@bschimke95 bschimke95 marked this pull request as ready for review December 6, 2024 08:21
@@ -23,8 +23,13 @@ func (e *Endpoints) postClusterJoin(s state.State, r *http.Request) response.Res
if err != nil {
return response.BadRequest(fmt.Errorf("invalid hostname %q: %w", req.Name, err))
}
// Check if the cluster is already bootstrapped
status, err := e.provider.MicroCluster().Status(r.Context())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

@louiseschmidtgen louiseschmidtgen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I can't approve the PR since I've created it.

@@ -31,8 +31,12 @@ func (e *Endpoints) postClusterBootstrap(_ state.State, r *http.Request) respons
}

// Check if the cluster is already bootstrapped
_, err = e.provider.MicroCluster().Status(r.Context())
if err == nil {
status, err := e.provider.MicroCluster().Status(r.Context())
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great find @bschimke95! Thanks for resolving this bug.

Copy link
Contributor

@bschimke95 bschimke95 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bschimke95 bschimke95 merged commit 9536f34 into main Dec 6, 2024
18 checks passed
@bschimke95 bschimke95 deleted the KU-1965/dqlite-lts branch December 6, 2024 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants