Skip to content

Kubernetes 1.7.0 local storage teardown failed #48331

Closed
@CallMeFoxie

Description

/kind bug

Tearing down (for example simple updating pods in stateful set) of local-storage PVC seems to be broken:

I0630 10:46:44.480172 24010 reconciler.go:186] operationExecutor.UnmountVolume started for volume "test" (UniqueName: "kubernetes.io/local-volume/97513921-5d70-11e7-a549-180373f4ecc0-test-affinity-test-1") pod "97513921-5d70-11e7-a549-180373f4ecc0" (UID: "97513921-5d70-11e7-a549-180373f4ecc0")
I0630 10:46:44.480243 24010 local.go:271] Unmounting volume "test-affinity-test-1" at path "/www/adm/kubernetes/root/pods/97513921-5d70-11e7-a549-> 180373f4ecc0/volumes/kubernetes.iolocal-volume/test-affinity-test-1"
W0630 10:46:44.480277 24010 util.go:87] Warning: "/www/adm/kubernetes/root/pods/97513921-5d70-11e7-a549-180373f4ecc0/volumes/kubernetes.io
local-volume/test-affinity-test-1" is not a mountpoint, deleting
E0630 10:46:44.480328 24010 nestedpendingoperations.go:262] Operation for ""kubernetes.io/local-volume/97513921-5d70-11e7-a549-180373f4ecc0-test-affinity-test-1" ("97513921-5d70-11e7-a549-180373f4ecc0")" failed. No retries permitted until 2017-06-30 10:46:48.48030593 +0200 CEST (durationBeforeRetry 4s). Error: UnmountVolume.TearDown failed for volume "test" (UniqueName: "kubernetes.io/local-volume/97513921-5d70-11e7-a549-180373f4ecc0-test-affinity-test-1") pod "97513921-5d70-11e7-a549-180373f4ecc0" (UID: "97513921-5d70-11e7-a549-180373f4ecc0") : remove /www/adm/kubernetes/root/pods/97513921-5d70-11e7-a549-180373f4ecc0/volumes/kubernetes.io~local-volume/test-affinity-test-1: device or resource busy

I've managed to track it down to
pkg/volume/local/local.go calling through some pkg/volume/util/util.go mounter.IsLikelyNotMountPoint(dir)

which literally has written in its comments:

// IsLikelyNotMountPoint determines if a directory is not a mountpoint.
// It is fast but not necessarily ALWAYS correct. If the path is in fact
// a bind mount from one part of a mount to another it will not be detected.
// mkdir /tmp/a /tmp/b; mount --bin /tmp/a /tmp/b; IsLikelyNotMountPoint("/tmp/b")
// will return true. When in fact /tmp/b is a mount point. If this situation
// if of interest to you, don't use this function...

which makes it detect it as a normal directory rather than a mount dir (as it is a normal directory... just bind mounted)

Environment:

  • Kubernetes version (use kubectl version): v1.7.0
  • Cloud provider or hardware configuration**: self hosted

Testing out a (dirty?) patch as we're speaking

Metadata

Assignees

Labels

kind/bugCategorizes issue or PR as related to a bug.sig/storageCategorizes an issue or PR as relevant to SIG Storage.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions