diff --git a/args.go b/args.go index e4cd0ca709..b1beb074f6 100644 --- a/args.go +++ b/args.go @@ -435,8 +435,6 @@ const ( ArgDatabaseTopicSegmentJitterMS = "segment-jitter-ms" // ArgDatabaseTopicSegmentMS is the period of time, in ms, after which the log will be forced to roll if the segment file isn't full ArgDatabaseTopicSegmentMS = "segment-ms" - // ArgDatabaseTopicUncleanLeaderElectionEnable determines whether to allow replicas that are not insync to be elected as leaders as last resort - ArgDatabaseTopicUncleanLeaderElectionEnable = "unclean-leader-election-enable" // ArgPrivateNetworkUUID is the flag for VPC UUID ArgPrivateNetworkUUID = "private-network-uuid" diff --git a/commands/databases.go b/commands/databases.go index 06b1ebc1a7..429984b992 100644 --- a/commands/databases.go +++ b/commands/databases.go @@ -70,7 +70,6 @@ func Databases() *Command { nodeSizeDetails := "The size of the nodes in the database cluster, e.g. `db-s-1vcpu-1gb`` for a 1 CPU, 1GB node. For a list of available size slugs, visit: https://docs.digitalocean.com/reference/api/api-reference/#tag/Databases" nodeNumberDetails := "The number of nodes in the database cluster. Valid values are 1-3. In addition to the primary node, up to two standby nodes may be added for high availability." - storageSizeMiBDetails := "The amount of disk space allocated to the cluster. Applicable for PostgreSQL and MySQL clusters. This will be set to a default level based on the plan size selected, but can be increased in increments up to a maximum amount. For ranges, visit: https://www.digitalocean.com/pricing/managed-databases" cmdDatabaseCreate := CmdBuilder(cmd, RunDatabaseCreate, "create ", "Create a database cluster", `This command creates a database cluster with the specified name. There are a number of flags that customize the configuration, all of which are optional. Without any flags set, a single-node, single-CPU PostgreSQL database cluster will be created.`, Writer, @@ -78,7 +77,6 @@ There are a number of flags that customize the configuration, all of which are o AddIntFlag(cmdDatabaseCreate, doctl.ArgDatabaseNumNodes, "", defaultDatabaseNodeCount, nodeNumberDetails) AddStringFlag(cmdDatabaseCreate, doctl.ArgRegionSlug, "", defaultDatabaseRegion, "The region where the database cluster will be created, e.g. `nyc1` or `sfo2`") AddStringFlag(cmdDatabaseCreate, doctl.ArgSizeSlug, "", defaultDatabaseNodeSize, nodeSizeDetails) - AddIntFlag(cmdDatabaseCreate, doctl.ArgDatabaseStorageSizeMib, "", 0, storageSizeMiBDetails) AddStringFlag(cmdDatabaseCreate, doctl.ArgDatabaseEngine, "", defaultDatabaseEngine, "The database engine to be used for the cluster. Possible values are: `pg` for PostgreSQL, `mysql`, `redis`, `mongodb`, and `kafka`.") AddStringFlag(cmdDatabaseCreate, doctl.ArgVersion, "", "", "The database engine version, e.g. 14 for PostgreSQL version 14") AddStringFlag(cmdDatabaseCreate, doctl.ArgPrivateNetworkUUID, "", "", "The UUID of a VPC to create the database cluster in; the default VPC for the region will be used if excluded") @@ -118,15 +116,10 @@ You must specify the desired number of nodes and size of the nodes. For example: doctl databases resize ca9f591d-9999-5555-a0ef-1c02d1d1e352 --num-nodes 2 --size db-s-16vcpu-64gb -Database nodes cannot be resized to smaller sizes due to the risk of data loss. - -In addition, for PostgreSQL and MySQL clusters, you can provide a disk size in MiB, which will set the total storage (up to a certain range) to the cluster independently. Storage cannot be reduced from its current levels. For example: - - doctl databases resize ca9f591d-9999-5555-a0ef-1c02d1d1e352 --num-nodes 2 --size db-s-16vcpu-64gb --storage-size-mib 2048000`, Writer, +Database nodes cannot be resized to smaller sizes due to the risk of data loss.`, Writer, aliasOpt("rs")) AddIntFlag(cmdDatabaseResize, doctl.ArgDatabaseNumNodes, "", 0, nodeNumberDetails, requiredOpt()) AddStringFlag(cmdDatabaseResize, doctl.ArgSizeSlug, "", "", nodeSizeDetails, requiredOpt()) - AddIntFlag(cmdDatabaseResize, doctl.ArgDatabaseStorageSizeMib, "", 0, storageSizeMiBDetails) cmdDatabaseMigrate := CmdBuilder(cmd, RunDatabaseMigrate, "migrate ", "Migrate a database cluster to a new region", `This command migrates the specified database cluster to a new region`, Writer, aliasOpt("m")) @@ -301,12 +294,6 @@ func buildDatabaseCreateRequestFromArgs(c *CmdConfig) (*godo.DatabaseCreateReque r.PrivateNetworkUUID = privateNetworkUUID - storageSizeMibInt, err := c.Doit.GetInt(c.NS, doctl.ArgDatabaseStorageSizeMib) - if err != nil { - return nil, err - } - r.StorageSizeMib = uint64(storageSizeMibInt) - return r, nil } @@ -509,12 +496,6 @@ func buildDatabaseResizeRequestFromArgs(c *CmdConfig) (*godo.DatabaseResizeReque } r.SizeSlug = size - storageSizeMibInt, err := c.Doit.GetInt(c.NS, doctl.ArgDatabaseStorageSizeMib) - if err != nil { - return nil, err - } - r.StorageSizeMib = uint64(storageSizeMibInt) - return r, nil } @@ -1806,10 +1787,6 @@ func getDatabaseTopicConfigArgs(c *CmdConfig) *godo.TopicConfig { res.SegmentMS = &i } } - bVal, err = c.Doit.GetBoolPtr(c.NS, doctl.ArgDatabaseTopicUncleanLeaderElectionEnable) - if err == nil && bVal != nil { - res.UncleanLeaderElectionEnable = bVal - } return res } @@ -1905,8 +1882,6 @@ This command lists the following details for each partition of a given topic in "Specifies the maximum time (in ms) for random jitter that is subtracted from the scheduled segment roll time to avoid thundering herd problems") AddStringFlag(c, doctl.ArgDatabaseTopicSegmentMS, "", "", "Specifies the maximum time (in ms) to wait to force a log roll if the segment file isn't full. After this period, the log will be forced to roll") - AddBoolFlag(c, doctl.ArgDatabaseTopicUncleanLeaderElectionEnable, "", false, - "Specifies whether to allow replicas that are not insync to be elected as leader as a last resort. This may result in data loss since those leaders are not in sync") } return cmd } diff --git a/commands/displayers/database.go b/commands/displayers/database.go index 682982ac11..ea9c6207a8 100644 --- a/commands/displayers/database.go +++ b/commands/displayers/database.go @@ -963,12 +963,6 @@ func (dt *DatabaseKafkaTopic) KV() []map[string]interface{} { "value": *t.Config.SegmentMS, }) } - if t.Config.UncleanLeaderElectionEnable != nil { - cfg = append(cfg, map[string]interface{}{ - "key": "UncleanLeaderElectionEnable", - "value": *t.Config.UncleanLeaderElectionEnable, - }) - } o = append(o, cfg...) }