Skip to content

Commit

Permalink
*: Save Xenon's metadata to persistent storage. radondb#406
Browse files Browse the repository at this point in the history
Revert "Merge pull request radondb#413 from runkecheng/save_xenon_metadata"

This reverts commit a6386c7, reversing
changes made to f6932c6.

Subpath does not work in some environments, so we decided to share DATA storage volumes directly.
  • Loading branch information
runkecheng committed Apr 11, 2022
1 parent 4b5c926 commit fc22e66
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 25 deletions.
1 change: 0 additions & 1 deletion mysqlcluster/container/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ func (c *backupSidecar) getVolumeMounts() []corev1.VolumeMount {
{
Name: utils.DataVolumeName,
MountPath: utils.DataVolumeMountPath,
SubPath: utils.MysqlDataSubPath,
},
{
Name: utils.LogsVolumeName,
Expand Down
1 change: 0 additions & 1 deletion mysqlcluster/container/init_mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ func (c *initMysql) getVolumeMounts() []corev1.VolumeMount {
{
Name: utils.DataVolumeName,
MountPath: utils.DataVolumeMountPath,
SubPath: utils.MysqlDataSubPath,
},
{
Name: utils.LogsVolumeName,
Expand Down
1 change: 0 additions & 1 deletion mysqlcluster/container/init_mysql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ var (
{
Name: utils.DataVolumeName,
MountPath: utils.DataVolumeMountPath,
SubPath: utils.MysqlDataSubPath,
},
{
Name: utils.LogsVolumeName,
Expand Down
2 changes: 0 additions & 2 deletions mysqlcluster/container/init_sidecar.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,10 @@ func (c *initSidecar) getVolumeMounts() []corev1.VolumeMount {
corev1.VolumeMount{
Name: utils.DataVolumeName,
MountPath: utils.DataVolumeMountPath,
SubPath: utils.MysqlDataSubPath,
},
corev1.VolumeMount{
Name: utils.DataVolumeName,
MountPath: utils.XenonDataVolumeMountPath,
SubPath: utils.XenonDataSubPath,
},
)
}
Expand Down
8 changes: 2 additions & 6 deletions mysqlcluster/container/init_sidecar_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -458,15 +458,11 @@ func TestGetInitSidecarVolumeMounts(t *testing.T) {
persistenceVolumeMounts = append(persistenceVolumeMounts,
corev1.VolumeMount{
Name: utils.DataVolumeName,
MountPath: utils.DataVolumeMountPath,
SubPath: utils.MysqlDataSubPath,
},
MountPath: utils.DataVolumeMountPath},
corev1.VolumeMount{
Name: utils.DataVolumeName,
MountPath: utils.XenonDataVolumeMountPath,
SubPath: utils.XenonDataSubPath,
},
)
})
assert.Equal(t, persistenceVolumeMounts, persistenceCase.VolumeMounts)
}
}
1 change: 0 additions & 1 deletion mysqlcluster/container/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ func (c *mysql) getVolumeMounts() []corev1.VolumeMount {
{
Name: utils.DataVolumeName,
MountPath: utils.DataVolumeMountPath,
SubPath: utils.MysqlDataSubPath,
},
{
Name: utils.LogsVolumeName,
Expand Down
1 change: 0 additions & 1 deletion mysqlcluster/container/mysql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ func TestGetMysqlVolumeMounts(t *testing.T) {
{
Name: "data",
MountPath: "/var/lib/mysql",
SubPath: "mysql",
},
{
Name: "logs",
Expand Down
9 changes: 4 additions & 5 deletions mysqlcluster/container/xenon.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,14 @@ func (c *xenon) getVolumeMounts() []corev1.VolumeMount {
Name: utils.ScriptsVolumeName,
MountPath: utils.ScriptsVolumeMountPath,
},
{
Name: utils.DataVolumeName,
MountPath: utils.XenonDataVolumeMountPath,
SubPath: utils.XenonDataSubPath,
},
{
Name: utils.XenonVolumeName,
MountPath: utils.XenonVolumeMountPath,
},
{
Name: utils.DataVolumeName,
MountPath: utils.XenonDataVolumeMountPath,
},
{
Name: utils.SysLocalTimeZone,
MountPath: utils.SysLocalTimeZoneMountPath,
Expand Down
9 changes: 4 additions & 5 deletions mysqlcluster/container/xenon_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,14 @@ func TestGetXenonVolumeMounts(t *testing.T) {
Name: "scripts",
MountPath: "/scripts",
},
{
Name: "data",
MountPath: "/var/lib/xenon",
SubPath: "xenon",
},
{
Name: "xenon",
MountPath: "/etc/xenon",
},
{
Name: "data",
MountPath: "/var/lib/xenon",
},
{
Name: utils.SysLocalTimeZone,
MountPath: "/etc/localtime",
Expand Down
1 change: 1 addition & 0 deletions sidecar/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ var (

// dataPath is the mysql data path.
dataPath = utils.DataVolumeMountPath

// xenonMetaDataPath is the xenon metadata path.
xenonDataPath = utils.XenonDataVolumeMountPath

Expand Down
2 changes: 0 additions & 2 deletions utils/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,6 @@ const (
ScriptsVolumeMountPath = "/scripts"
XenonVolumeMountPath = "/etc/xenon"
InitFileVolumeMountPath = "/docker-entrypoint-initdb.d"
MysqlDataSubPath = "mysql"
XenonDataSubPath = "xenon"

// Volume timezone name.
SysLocalTimeZone = "localtime"
Expand Down

0 comments on commit fc22e66

Please sign in to comment.