osd: legacy osds on lvm pvcs crash on resize init container

OSDs on LVM-mode PVCs are failing to come up and crashing
in the expand-bluefs init container. To avoid the crash
and allow the OSDs to start, a workaround was found to
simply remove that init container. Now we disable the
OSD resize for this case to avoid others hitting this
during upgrade as well.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
This commit is contained in:
Travis Nielsen
2024-04-19 16:26:45 -06:00
parent be95c7052f
commit acd7b4faa0
2 changed files with 4 additions and 4 deletions
+2 -1
View File
@@ -580,8 +580,9 @@ func (c *Cluster) makeDeployment(osdProps osdProperties, osd OSDInfo, provisionC
initContainers = append(initContainers, c.getExpandEncryptedPVCInitContainer(osdDataDirPath, osdProps))
}
initContainers = append(initContainers, c.getActivatePVCInitContainer(osdProps, osdID))
// The expand init container fails for legacy LVM-based OSDs, so only supported expansion for raw mode OSDs
initContainers = append(initContainers, c.getExpandPVCInitContainer(osdProps, osdID))
}
initContainers = append(initContainers, c.getExpandPVCInitContainer(osdProps, osdID))
} else {
// Add the volume to the spec and the mount to the daemon container
// so that it can pick the already mounted/activated osd metadata path
+2 -3
View File
@@ -198,12 +198,11 @@ func testPodDevices(t *testing.T, dataDir, deviceName string, allDevices bool) {
deployment, err = c.makeDeployment(osdProp, osd, dataPathMap)
assert.Nil(t, err)
assert.NotNil(t, deployment)
assert.Equal(t, 5, len(deployment.Spec.Template.Spec.InitContainers), deployment.Spec.Template.Spec.InitContainers[2].Name)
assert.Equal(t, 4, len(deployment.Spec.Template.Spec.InitContainers), deployment.Spec.Template.Spec.InitContainers[2].Name)
assert.Equal(t, "config-init", deployment.Spec.Template.Spec.InitContainers[0].Name)
assert.Equal(t, "copy-bins", deployment.Spec.Template.Spec.InitContainers[1].Name)
assert.Equal(t, "blkdevmapper", deployment.Spec.Template.Spec.InitContainers[2].Name)
assert.Equal(t, "expand-bluefs", deployment.Spec.Template.Spec.InitContainers[3].Name)
assert.Equal(t, "chown-container-data-dir", deployment.Spec.Template.Spec.InitContainers[4].Name)
assert.Equal(t, "chown-container-data-dir", deployment.Spec.Template.Spec.InitContainers[3].Name)
assert.Equal(t, 1, len(deployment.Spec.Template.Spec.Containers))
initCont = deployment.Spec.Template.Spec.InitContainers[0]
assert.Equal(t, 5, len(initCont.VolumeMounts), initCont.VolumeMounts)