Skip to content

Commit e4e6713

Browse files
authored
Allow bypassing the downgrade check with the IgnoreUpgradabilityChecks flag. (#2278)
* Allow bypassing the downgrade check with the IgnoreUpgradabilityChecks flag. * Add documentation on the new behavior of this flag.
1 parent e0143e5 commit e4e6713

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

api/v1beta2/foundationdbcluster_types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ type FoundationDBClusterSpec struct {
180180
// Routing defines the configuration for routing to our pods.
181181
Routing RoutingConfig `json:"routing,omitempty"`
182182

183-
// IgnoreUpgradabilityChecks determines whether we should skip the check for
184-
// client compatibility when performing an upgrade.
183+
// IgnoreUpgradabilityChecks determines whether we should skip the checks for
184+
// version compatibility when performing an upgrade.
185185
IgnoreUpgradabilityChecks bool `json:"ignoreUpgradabilityChecks,omitempty"`
186186

187187
// Buggify defines settings for injecting faults into a cluster for testing.

controllers/check_client_compatibility.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ func (c checkClientCompatibility) reconcile(_ context.Context, r *FoundationDBCl
4343
return nil
4444
}
4545

46+
if cluster.Spec.IgnoreUpgradabilityChecks {
47+
return nil
48+
}
49+
4650
runningVersion, err := fdbv1beta2.ParseFdbVersion(cluster.Status.RunningVersion)
4751
if err != nil {
4852
return &requeue{curError: err}
@@ -61,10 +65,6 @@ func (c checkClientCompatibility) reconcile(_ context.Context, r *FoundationDBCl
6165
return nil
6266
}
6367

64-
if cluster.Spec.IgnoreUpgradabilityChecks {
65-
return nil
66-
}
67-
6868
adminClient, err := r.getAdminClient(logger, cluster)
6969
if err != nil {
7070
return &requeue{curError: err}

docs/cluster_spec.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ FoundationDBClusterSpec defines the desired state of a cluster.
260260
| processGroupIDPrefix | ProcessGroupIDPrefix defines a prefix to append to the process group IDs in the locality fields. This must be a valid Kubernetes label value. See https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#syntax-and-character-set for more details on that. | string | false |
261261
| lockOptions | LockOptions allows customizing how we manage locks for global operations. | [LockOptions](#lockoptions) | false |
262262
| routing | Routing defines the configuration for routing to our pods. | [RoutingConfig](#routingconfig) | false |
263-
| ignoreUpgradabilityChecks | IgnoreUpgradabilityChecks determines whether we should skip the check for client compatibility when performing an upgrade. | bool | false |
263+
| ignoreUpgradabilityChecks | IgnoreUpgradabilityChecks determines whether we should skip the checks for version compatibility when performing an upgrade. | bool | false |
264264
| buggify | Buggify defines settings for injecting faults into a cluster for testing. | [BuggifyConfig](#buggifyconfig) | false |
265265
| storageServersPerPod | StorageServersPerPod defines how many Storage Servers should run in a single process group (Pod). This number defines the number of processes running in one Pod whereas the ProcessCounts defines the number of Pods created. This means that you end up with ProcessCounts[\"storage\"] * StorageServersPerPod storage processes. | int | false |
266266
| logServersPerPod | LogServersPerPod defines how many Log Servers should run in a single process group (Pod). This number defines the number of processes running in one Pod whereas the ProcessCounts defines the number of Pods created. This means that you end up with ProcessCounts[\"Log\"] * LogServersPerPod log processes. This also affects processes with the transaction class. | int | false |

docs/manual/technical_design.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,9 @@ The `UpdateConfigMap` subreconciler creates a `ConfigMap` object for the cluster
146146

147147
The `CheckClientCompatibility` subreconciler is used during upgrades to ensure that every client is compatible with the new version of FoundationDB. When it detects that the `version` in the cluster spec is protocol-compatible with the `runningVersion` in the cluster status, this will do nothing. When these are different, it means there is a pending upgrade. This subreconciler will check the `connected_clients` field in the database status, and if it finds any clients whose max supported protocol version is not the same as the `version` from the cluster spec, it will fail reconciliation. This prevents upgrading a database until all clients have been updated with a compatible client library.
148148

149-
You can skip this check by setting the `ignoreUpgradabilityChecks` flag in the cluster spec.
149+
This subreconciler will also ensure that if the versions are protocol-incompatible, the new version is more recent than the cluster's current version. The level of support for protocol-incompatible downgrades is more nuanced than the path for upgrades, and the [FoundationDB docs](https://apple.github.io/foundationdb/administration.html#version-specific-notes-on-downgrading) have more details on this path.
150+
151+
You can skip these checks by setting the `ignoreUpgradabilityChecks` flag in the cluster spec.
150152

151153
### DeletePodsForBuggification
152154

0 commit comments

Comments
 (0)