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

Operator changes to remove enable_semi_sync #364

Merged
merged 3 commits into from
Jan 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions deploy/crds/planetscale.com_vitessclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1023,8 +1023,6 @@ spec:
type: object
replication:
properties:
enforceSemiSync:
type: boolean
initializeBackup:
type: boolean
initializeMaster:
Expand Down Expand Up @@ -1376,8 +1374,6 @@ spec:
type: object
replication:
properties:
enforceSemiSync:
type: boolean
initializeBackup:
type: boolean
initializeMaster:
Expand Down
4 changes: 0 additions & 4 deletions deploy/crds/planetscale.com_vitesskeyspaces.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,6 @@ spec:
type: object
replication:
properties:
enforceSemiSync:
type: boolean
initializeBackup:
type: boolean
initializeMaster:
Expand Down Expand Up @@ -612,8 +610,6 @@ spec:
type: object
replication:
properties:
enforceSemiSync:
type: boolean
initializeBackup:
type: boolean
initializeMaster:
Expand Down
2 changes: 0 additions & 2 deletions deploy/crds/planetscale.com_vitessshards.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,6 @@ spec:
type: string
replication:
properties:
enforceSemiSync:
type: boolean
initializeBackup:
type: boolean
initializeMaster:
Expand Down
2 changes: 0 additions & 2 deletions deploy/example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ spec:
databaseInitScriptSecret:
name: example-cluster-config
key: init_db.sql
replication:
enforceSemiSync: true
tabletPools:
- cell: gcpuswest1b
type: replica
Expand Down
25 changes: 1 addition & 24 deletions docs/api/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5800,7 +5800,7 @@ <h3 id="planetscale.com/v2.VitessKeyspaceTemplate">VitessKeyspaceTemplate
<td>
<p>VitessOrchestrator deploys a set of Vitess Orchestrator (vtorc) servers for the Keyspace.
It is highly recommended that you set disable_active_reparents=true
and enable_semi_sync=false for the vtablets if enabling vtorc.</p>
for the vttablets if enabling vtorc.</p>
</td>
</tr>
<tr>
Expand Down Expand Up @@ -6198,29 +6198,6 @@ <h3 id="planetscale.com/v2.VitessReplicationSpec">VitessReplicationSpec
<tbody>
<tr>
<td>
<code>enforceSemiSync</code></br>
<em>
bool
</em>
</td>
<td>
<p>EnforceSemiSync means Vitess will configure MySQL to require semi-sync
acknowledgement of all transactions while forbidding fallback to
asynchronous replication under any circumstance.</p>
<p>Note that this is different from merely <em>enabling</em> semi-sync, which in
its default configuration allows fallback to asynchronous replication
if no replicas are connected or if they don&rsquo;t respond after a few seconds.
Enforced semi-sync is a mode that prefers master unavailability when
durability cannot be ensured, rather than risking the loss of data that
was already reported to clients as committed.</p>
<p>WARNING: Do not enable this if the shard has fewer than 3 master-eligible
replicas, as that may lead to master unavailability during routine
maintenance.</p>
<p>Default: Semi-sync is not enforced.</p>
</td>
</tr>
<tr>
<td>
<code>initializeMaster</code></br>
<em>
bool
Expand Down
7 changes: 7 additions & 0 deletions docs/release-notes/2_9_0_summary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## Major Changes

### EnforceSemiSync Removal

The config `enforceSemiSync` is removed from the `VitessReplicationSpec`. This configuration is no longer requied.
If the users want to configure semi-sync replication, they should set the `durabilityPolicy` config to `semi_sync` in the keyspace specification.
This change of not using `enforceSemiSync` should be done before upgrading to `2.9.0` version of the operator otherwise the configuration would not be accepted.
2 changes: 1 addition & 1 deletion pkg/apis/planetscale/v2/vitesskeyspace_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ type VitessKeyspaceTemplate struct {

// VitessOrchestrator deploys a set of Vitess Orchestrator (vtorc) servers for the Keyspace.
// It is highly recommended that you set disable_active_reparents=true
// and enable_semi_sync=false for the vtablets if enabling vtorc.
// for the vttablets if enabling vtorc.
VitessOrchestrator *VitessOrchestratorSpec `json:"vitessOrchestrator,omitempty"`

// Partitionings specify how to divide the keyspace up into shards by
Expand Down
18 changes: 0 additions & 18 deletions pkg/apis/planetscale/v2/vitessshard_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,24 +129,6 @@ type VitessShardTemplate struct {

// VitessReplicationSpec specifies how Vitess will set up MySQL replication.
type VitessReplicationSpec struct {
// EnforceSemiSync means Vitess will configure MySQL to require semi-sync
// acknowledgement of all transactions while forbidding fallback to
// asynchronous replication under any circumstance.
//
// Note that this is different from merely *enabling* semi-sync, which in
// its default configuration allows fallback to asynchronous replication
// if no replicas are connected or if they don't respond after a few seconds.
// Enforced semi-sync is a mode that prefers master unavailability when
// durability cannot be ensured, rather than risking the loss of data that
// was already reported to clients as committed.
//
// WARNING: Do not enable this if the shard has fewer than 3 master-eligible
// replicas, as that may lead to master unavailability during routine
// maintenance.
//
// Default: Semi-sync is not enforced.
EnforceSemiSync bool `json:"enforceSemiSync,omitempty"`

// InitializeMaster specifies whether to choose an initial master for a
// new or restored shard that has no master yet.
//
Expand Down
1 change: 0 additions & 1 deletion pkg/controller/vitessshard/reconcile_tablets.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,6 @@ func vttabletSpecs(vts *planetscalev2.VitessShard, parentLabels map[string]strin
KeyspaceName: keyspaceName,
DatabaseName: vts.Spec.DatabaseName,
DatabaseInitScriptSecret: vts.Spec.DatabaseInitScriptSecret,
EnableSemiSync: vts.Spec.Replication.EnforceSemiSync,
Annotations: annotations,
BackupLocation: backupLocation,
BackupEngine: vts.Spec.BackupEngine,
Expand Down
2 changes: 1 addition & 1 deletion pkg/operator/vttablet/datastore.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package vttablet

import (
corev1 "k8s.io/api/core/v1"

"planetscale.dev/vitess-operator/pkg/operator/lazy"
"planetscale.dev/vitess-operator/pkg/operator/secrets"
"planetscale.dev/vitess-operator/pkg/operator/vitess"
Expand Down Expand Up @@ -90,7 +91,6 @@ func localDatastoreFlags(spec *Spec) vitess.Flags {
// TODO: Should this be configurable?
"enable_replication_reporter": true,

"enable_semi_sync": spec.EnableSemiSync,
"mysqlctl_socket": mysqlctlSocketPath,
"mycnf_socket_file": mysqlSocketPath,
}
Expand Down
1 change: 0 additions & 1 deletion pkg/operator/vttablet/spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ type Spec struct {
DataVolumePVCName string
GlobalLockserver planetscalev2.VitessLockserverParams
DatabaseInitScriptSecret planetscalev2.SecretSource
EnableSemiSync bool
Annotations map[string]string
ExtraLabels map[string]string
BackupLocation *planetscalev2.VitessBackupLocation
Expand Down
10 changes: 0 additions & 10 deletions test/endtoend/operator/operator-latest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2179,8 +2179,6 @@ spec:
type: object
replication:
properties:
enforceSemiSync:
type: boolean
initializeBackup:
type: boolean
initializeMaster:
Expand Down Expand Up @@ -2532,8 +2530,6 @@ spec:
type: object
replication:
properties:
enforceSemiSync:
type: boolean
initializeBackup:
type: boolean
initializeMaster:
Expand Down Expand Up @@ -3743,8 +3739,6 @@ spec:
type: object
replication:
properties:
enforceSemiSync:
type: boolean
initializeBackup:
type: boolean
initializeMaster:
Expand Down Expand Up @@ -4096,8 +4090,6 @@ spec:
type: object
replication:
properties:
enforceSemiSync:
type: boolean
initializeBackup:
type: boolean
initializeMaster:
Expand Down Expand Up @@ -4981,8 +4973,6 @@ spec:
type: string
replication:
properties:
enforceSemiSync:
type: boolean
initializeBackup:
type: boolean
initializeMaster:
Expand Down