Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(zfspv): handling unmounted volume #78

Merged
merged 1 commit into from
Apr 11, 2020
Merged

feat(zfspv): handling unmounted volume #78

merged 1 commit into from
Apr 11, 2020

Commits on Apr 9, 2020

  1. feat(zfspv): handling unmounted volume

    There can be cases where openebs namespace has been accidently deleted (Optoro case: https://mdap.zendesk.com/agent/tickets/963), There the driver attempted to destroy the dataset which will first umount the dataset and then try to destroy it, the destroy will fail as volume is busy. Here, as mentioned in the steps to recover, we have to manually mount the dataset
    ```
    6. The driver might have attempted to destroy the volume before going down, which sets the mount as no(this strange behavior on gke ubuntu 18.04), we have to mount the dataset, go to the each node and check if there is any unmounted volume
    zfs get mounted
    if there is any unmounted dataset with this option as "no", we should do the below :-
    mountpath=zfs get -Hp -o value mountpoint <dataset name>
    zfs set mountpoint=none
    zfs set mountpoint=<mountpath>
    this will set the dataset to be mounted.
    ```
    
    So in this case the volume will be  unmounted and still mountpoint will set to the mountpath, so if application pod is deleted later on, it will try to mount the zfs dataset, here just setting the `mountpoint` is not sufficient, as if we have unmounted the zfs dataset (via zfs destroy in this case), so we have to explicitely mount the dataset **otherwise application will start running without any persistence storage**. Here automating the manual steps performed to resolve the problem, we are checking in the code that if zfs dataset is not mounted after setting the mountpoint property, attempt to mount it.
    
    This is not the case with the zvol as it does not attempt to unmount it, so zvols are fine.
    
    Also NodeUnPublish operation MUST be idempotent. If this RPC failed, or the CO does not know if it failed or not, it can choose to call NudeUnPublishRequest again. So handled this and returned successful if volume is not mounted also added descriptive error messages at few places.
    
    Signed-off-by: Pawan <pawan@mayadata.io>
    pawanpraka1 authored and kmova committed Apr 9, 2020
    Configuration menu
    Copy the full SHA
    3a1a8e7 View commit details
    Browse the repository at this point in the history