diff --git a/CHANGELOG.md b/CHANGELOG.md index 9711540..1c02e1a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,20 @@ The format is based on [Keep a Changelog][keepachangelog] and adheres to [Semant ### Deprecated ### Fixed +## [0.63.1] - 2025-11-10 + +### Added +\n +### Changed +- Increased the default minimum cluster size for database environments from 1 to 3. + +### Deprecated + +### Removed + +### Fixed +- Prevented unnecessary cluster recovery attempts when a node starts up as the first node (fresh bootstrap). + ## [0.63.0] - 2025-11-10 ### Added diff --git a/Makefile b/Makefile index e05452f..91d8f51 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,7 @@ test-e2e: .PHONY: build clean test run-node run-node2 run-node3 run-example deps tidy fmt vet lint clear-ports install-hooks kill -VERSION := 0.63.0 +VERSION := 0.63.1 COMMIT ?= $(shell git rev-parse --short HEAD 2>/dev/null || echo unknown) DATE ?= $(shell date -u +%Y-%m-%dT%H:%M:%SZ) LDFLAGS := -X 'main.version=$(VERSION)' -X 'main.commit=$(COMMIT)' -X 'main.date=$(DATE)' diff --git a/pkg/environments/templates/bootstrap.yaml b/pkg/environments/templates/bootstrap.yaml index 9b13905..aa3eb60 100644 --- a/pkg/environments/templates/bootstrap.yaml +++ b/pkg/environments/templates/bootstrap.yaml @@ -17,7 +17,7 @@ database: rqlite_join_address: "" cluster_sync_interval: "30s" peer_inactivity_limit: "24h" - min_cluster_size: 1 + min_cluster_size: 3 ipfs: cluster_api_url: "http://localhost:{{.ClusterAPIPort}}" api_url: "http://localhost:{{.IPFSAPIPort}}" diff --git a/pkg/environments/templates/node.yaml b/pkg/environments/templates/node.yaml index 2ac9551..bc72840 100644 --- a/pkg/environments/templates/node.yaml +++ b/pkg/environments/templates/node.yaml @@ -17,7 +17,7 @@ database: rqlite_join_address: "{{.RQLiteJoinAddress}}" cluster_sync_interval: "30s" peer_inactivity_limit: "24h" - min_cluster_size: 1 + min_cluster_size: 3 ipfs: cluster_api_url: "http://localhost:{{.ClusterAPIPort}}" api_url: "http://localhost:{{.IPFSAPIPort}}" diff --git a/pkg/rqlite/rqlite.go b/pkg/rqlite/rqlite.go index a2cb00c..679d627 100644 --- a/pkg/rqlite/rqlite.go +++ b/pkg/rqlite/rqlite.go @@ -826,9 +826,12 @@ func (r *RQLiteManager) performPreStartClusterDiscovery(ctx context.Context, rql time.Sleep(2 * time.Second) } - if discoveredPeers == 0 { - r.logger.Warn("No peers discovered during pre-start discovery window, will attempt solo recovery") - // Continue anyway - might be the only node left + // CRITICAL FIX: Skip recovery if no peers were discovered (other than ourselves) + // Only ourselves in the cluster means this is a fresh bootstrap, not a recovery scenario + if discoveredPeers <= 1 { + r.logger.Info("No peers discovered during pre-start discovery window - skipping recovery (fresh bootstrap)", + zap.Int("discovered_peers", discoveredPeers)) + return nil } // Trigger final sync to ensure peers.json is up to date with latest discovered peers