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

fix(cspi): import pool without cachefile #77

Merged
merged 6 commits into from
May 20, 2020

Conversation

mittachaitu
Copy link
Contributor

@mittachaitu mittachaitu commented May 19, 2020

Signed-off-by: mittachaitu sai.chaithanya@mayadata.io
This PR will try to import the pool without the cache file as a last option.
It will import the pool in the following ways:

  • Import the pool using cachefile zpool import -c cachefile=<cache_file> -o cachefile=<cache_file> <pool_name>
  • Import the pool without using cachefile:
    1. If it is sparse based pool then command will be zpool import -o cachefile=<cache_file> -d <parent_directory_of_sparse_file> <pool_name>
    2. If it device based pool then command will be zpool import -o cachefile=<cache_file> <pool_name>(By default it will scan /dev directory).

Impact to users:

  • When users tried to create a pool and if there are any bad block files attached to the node then the pool will not be created(process tries to scan all the block files to identify disk having pool and it will get stuck if it tries to read bad from block file).

NOTE:

  • Due to bug in persisting the cachefile i.e cachefile is not stored in the persistent path because of this when pool pod got restarted then the pool will not be imported to fix this added the code to import without cachefile.

Signed-off-by: mittachaitu <sai.chaithanya@mayadata.io>
Copy link
Contributor

@shubham14bajpai shubham14bajpai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtn

@mittachaitu
Copy link
Contributor Author

go.mod needs to be updated once PR got merged openebs-archive/api#48

Signed-off-by: mittachaitu <sai.chaithanya@mayadata.io>
Signed-off-by: mittachaitu <sai.chaithanya@mayadata.io>
@mittachaitu mittachaitu self-assigned this May 20, 2020
Signed-off-by: mittachaitu <sai.chaithanya@mayadata.io>
echo "cache file is not present in persistent path"
exit 1
fi

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome job for adding this to ci. ❤️

Copy link
Contributor

@sonasingh46 sonasingh46 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes are good.

Signed-off-by: mittachaitu <sai.chaithanya@mayadata.io>
cmdOut, err = zfs.NewPoolImport().
WithCachefile(cacheFile).
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kmova @sonasingh46 Removed -c cachefile option in the import command for sparse based pool. While building the command directory option will be ignored if cachefile is set.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed -- let us make the workflow :

  1. Cache file import
  2. Then, directory-based import if above fails

For all the pool type -- whether be sparse or disk.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pushed the changes!! Verifying the same

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good.

Signed-off-by: mittachaitu <sai.chaithanya@mayadata.io>
Copy link
Contributor

@prateekpandey14 prateekpandey14 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@sonasingh46 sonasingh46 merged commit 82931c0 into openebs-archive:master May 20, 2020
mittachaitu pushed a commit to mittachaitu/cstor-operators that referenced this pull request May 20, 2020
* fix(cspi): fix the import pool bug

This commits fixes a bug due to which pool import was failing
in case of pool manager pod restarts.

Signed-off-by: mittachaitu <sai.chaithanya@mayadata.io>
prateekpandey14 pushed a commit that referenced this pull request May 20, 2020
This commits fixes a bug due to which pool import was failing
in case of pool manager pod restarts.

Signed-off-by: mittachaitu <sai.chaithanya@mayadata.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants