kubernetes-sigs/gcp-compute-persistent-disk-csi-driver

Sync Mount/Flush Block Device on NodeUnstage

Closed this issue · 5 comments

The NodeUnpublishVolume -> NodeUnstageVolume -> ControllerUnpublishVolume flow does not explicitly perform a filesystem sync in linux. The driver calls umount on the staged block device path. If the block device is not mounted elsewhere in the OS, this results in a successful sync and unmount. Files are correctly flushed to the disk.

If the mount is being used elsewhere in the system (via private mount in an alternate namespace), the removal of the driver's mount may not result in the block device being flushed and unmounted. The consequence is that ControllerUnpublishVolume may proceed with removing a block device from a VM while there could be pending block writes at the kernel layer (cached at the filesystme).

This is being done explicitly in windows (https://github.com/kubernetes-csi/csi-proxy/blob/ba9a0a80d071f1ad4650d84abaea043b08e6496e/pkg/os/volume/api.go#L141), but not in linux.

Two options:

  1. Explicitly call sync on the underlying mount prior to unmounting in NodeUnstage
  2. Flush the block device with blockdev --flush during NodeUnstage

Related to #1657. We may still need to sync/flush the block device after validating it is not being used as a filesystem. Keeping this open still.

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle rotten
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

@k8s-triage-robot: Closing this issue, marking it as "Not Planned".

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.