Skip to content

Commit

Permalink
PMM-7914 DBaaS: upgrade database (#768)
Browse files Browse the repository at this point in the history
* Add db_version to update cluster rpcs

* add available and installed version

* use image as in database creation

* add status to indicate upgrade is running

* returned installed and available image to be consistent

We use image for upgrading and creating of clusters.

* fix typo
  • Loading branch information
Jan Prukner authored Oct 6, 2021
1 parent e1e8665 commit 6dee93c
Show file tree
Hide file tree
Showing 10 changed files with 647 additions and 444 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 36 additions & 4 deletions api/managementpb/dbaas/json/dbaas.json
Original file line number Diff line number Diff line change
Expand Up @@ -2339,6 +2339,11 @@
"format": "int32",
"x-order": 0
},
"image": {
"description": "PSMDB image to use. If it's the same image but with different version tag, upgrade of database cluster to version\nin given tag is triggered. If entirely different image is given, error is returned.",
"type": "string",
"x-order": 4
},
"replicaset": {
"description": "ReplicaSet container parameters.",
"type": "object",
Expand Down Expand Up @@ -2581,11 +2586,21 @@
"description": "Cluster represents PSMDB cluster information.\nTODO Do not use inner messages in all public APIs (for consistency).",
"type": "object",
"properties": {
"available_image": {
"description": "Available database version user can upgrade cluster to, returned as an image. Image tag contains the version.\nIf it's empty, no upgrade is available.",
"type": "string",
"x-order": 6
},
"exposed": {
"description": "DB cluster accessible outside of K8s cluster.",
"type": "boolean",
"x-order": 4
},
"installed_image": {
"description": "Installed PSMDB image.",
"type": "string",
"x-order": 5
},
"name": {
"description": "Cluster name.",
"type": "string",
Expand Down Expand Up @@ -2666,7 +2681,7 @@
"x-order": 3
},
"state": {
"description": "PSMDBClusterState represents PSMDB cluster CR state.\n\n - PSMDB_CLUSTER_STATE_INVALID: PSMDB_CLUSTER_STATE_INVALID represents unknown state.\n - PSMDB_CLUSTER_STATE_CHANGING: PSMDB_CLUSTER_STATE_CHANGING represents a cluster being changed.\n - PSMDB_CLUSTER_STATE_READY: PSMDB_CLUSTER_STATE_READY represents a cluster without pending changes.\n - PSMDB_CLUSTER_STATE_FAILED: PSMDB_CLUSTER_STATE_FAILED represents a failed cluster.\n - PSMDB_CLUSTER_STATE_DELETING: PSMDB_CLUSTER_STATE_DELETING represents a cluster being deleting.\n - PSMDB_CLUSTER_STATE_PAUSED: PSMDB_CLUSTER_STATE_PAUSED represents a cluster is paused.",
"description": "PSMDBClusterState represents PSMDB cluster CR state.\n\n - PSMDB_CLUSTER_STATE_INVALID: PSMDB_CLUSTER_STATE_INVALID represents unknown state.\n - PSMDB_CLUSTER_STATE_CHANGING: PSMDB_CLUSTER_STATE_CHANGING represents a cluster being changed.\n - PSMDB_CLUSTER_STATE_READY: PSMDB_CLUSTER_STATE_READY represents a cluster without pending changes.\n - PSMDB_CLUSTER_STATE_FAILED: PSMDB_CLUSTER_STATE_FAILED represents a failed cluster.\n - PSMDB_CLUSTER_STATE_DELETING: PSMDB_CLUSTER_STATE_DELETING represents a cluster being deleting.\n - PSMDB_CLUSTER_STATE_PAUSED: PSMDB_CLUSTER_STATE_PAUSED represents a cluster is paused.\n - PSMDB_CLUSTER_STATE_UPGRADING: PSMDB_CLUSTER_STATE_UPGRADING is a special case of PSMDB_CLUSTER_STATE_CHANGING.\nIt indicates database cluster upgrade is ongoing.",
"type": "string",
"default": "PSMDB_CLUSTER_STATE_INVALID",
"enum": [
Expand All @@ -2675,7 +2690,8 @@
"PSMDB_CLUSTER_STATE_READY",
"PSMDB_CLUSTER_STATE_FAILED",
"PSMDB_CLUSTER_STATE_DELETING",
"PSMDB_CLUSTER_STATE_PAUSED"
"PSMDB_CLUSTER_STATE_PAUSED",
"PSMDB_CLUSTER_STATE_UPGRADING"
],
"x-order": 1
}
Expand Down Expand Up @@ -3407,6 +3423,11 @@
}
},
"x-order": 0
},
"image": {
"description": "Image to use. If it's the same image but with different version tag, upgrade of database cluster to version\nin given tag is triggered. If entirely different image is given, error is returned.",
"type": "string",
"x-order": 1
}
},
"x-order": 1
Expand Down Expand Up @@ -3622,11 +3643,21 @@
"description": "Cluster represents XtraDB cluster information.\nTODO Do not use inner messages in all public APIs (for consistency).",
"type": "object",
"properties": {
"available_image": {
"description": "Available database version user can upgrade cluster to, returned as an image. Image tag contains the version.\nIf it's empty, no upgrade is available.",
"type": "string",
"x-order": 6
},
"exposed": {
"description": "DB cluster accessible outside of K8s cluster.",
"type": "boolean",
"x-order": 4
},
"installed_image": {
"description": "Installed XtraDB image.",
"type": "string",
"x-order": 5
},
"name": {
"description": "Cluster name.",
"type": "string",
Expand Down Expand Up @@ -3775,7 +3806,7 @@
"x-order": 3
},
"state": {
"description": "XtraDBClusterState represents XtraDB cluster CR state.\n\n - XTRA_DB_CLUSTER_STATE_INVALID: XTRA_DB_CLUSTER_STATE_INVALID represents unknown state.\n - XTRA_DB_CLUSTER_STATE_CHANGING: XTRA_DB_CLUSTER_STATE_CHANGING represents a cluster being changed.\n - XTRA_DB_CLUSTER_STATE_READY: XTRA_DB_CLUSTER_STATE_READY represents a cluster without pending changes.\n - XTRA_DB_CLUSTER_STATE_FAILED: XTRA_DB_CLUSTER_STATE_FAILED represents a failed cluster.\n - XTRA_DB_CLUSTER_STATE_DELETING: XTRA_DB_CLUSTER_STATE_DELETING represents a cluster being deleting.\n - XTRA_DB_CLUSTER_STATE_PAUSED: XTRA_DB_CLUSTER_STATE_PAUSED represents a cluster is paused.",
"description": "XtraDBClusterState represents XtraDB cluster CR state.\n\n - XTRA_DB_CLUSTER_STATE_INVALID: XTRA_DB_CLUSTER_STATE_INVALID represents unknown state.\n - XTRA_DB_CLUSTER_STATE_CHANGING: XTRA_DB_CLUSTER_STATE_CHANGING represents a cluster being changed.\n - XTRA_DB_CLUSTER_STATE_READY: XTRA_DB_CLUSTER_STATE_READY represents a cluster without pending changes.\n - XTRA_DB_CLUSTER_STATE_FAILED: XTRA_DB_CLUSTER_STATE_FAILED represents a failed cluster.\n - XTRA_DB_CLUSTER_STATE_DELETING: XTRA_DB_CLUSTER_STATE_DELETING represents a cluster being deleting.\n - XTRA_DB_CLUSTER_STATE_PAUSED: XTRA_DB_CLUSTER_STATE_PAUSED represents a cluster is paused.\n - XTRA_DB_CLUSTER_STATE_UPGRADING: XTRA_DB_CLUSTER_STATE_UPGRADING is a special case of XTRA_DB_CLUSTER_STATE_CHANGING.\nIt indicates database cluster upgrade is ongoing.",
"type": "string",
"default": "XTRA_DB_CLUSTER_STATE_INVALID",
"enum": [
Expand All @@ -3784,7 +3815,8 @@
"XTRA_DB_CLUSTER_STATE_READY",
"XTRA_DB_CLUSTER_STATE_FAILED",
"XTRA_DB_CLUSTER_STATE_DELETING",
"XTRA_DB_CLUSTER_STATE_PAUSED"
"XTRA_DB_CLUSTER_STATE_PAUSED",
"XTRA_DB_CLUSTER_STATE_UPGRADING"
],
"x-order": 1
}
Expand Down
Loading

0 comments on commit 6dee93c

Please sign in to comment.