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
Allow for '-o feature@<feature>=disable' on the command line. #3465
Conversation
Note that this still contains debugging output and fails the cstyle. But input on it should be possible. |
d4388b7
to
a007aa3
Compare
a007aa3
to
2d6ae3b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change needs to be rebased on master, have the man pages updated, and a test case added to ensure it's behaving as designed. That will make it much easier to review and get a feel for the proposed command line interface.
Apparently the test cases already exists: tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_001_pos.ksh:
I'm going to setup a couple of test machines to try this, but do these tests run cleanly/successfully now? |
2d6ae3b
to
943db61
Compare
All 4 of the |
Ok, so if this works already, then maybe we don't need this PR? |
The test case |
Ah, right. Is that something we want? I find it kind'a useful, but I create pools so seldom, I haven't used it (this functionality) in a long time.. |
It could prove handy particularly as we accumulate more features but it's definitely not crucial. Unless you're excited to dive in to implement this I suggest we close it for now. We can always revisit implementation this when it's really needed or someone wants to work on it. |
No, that's ok. The code is there, I just need to create the test cases for it. |
Is there a way to, programmatically, discover what features are available? So that I don't have to hard code them in the test script(s).. I found a couple of ways to do it, but they all require an existing pool to query ( |
I'm looking over the other script, and I think this will break |
Aside from the method you described there isn't an easy way to do this. Although in this case I don't think it's necessary, it would be OK to just use a couple existing features to validate it's behaving as desired. It would be ideal to verify them all but even verifying a handful provides decent test coverage.
I think this can be done without breaking any of the existing test cases. And that's critical because we can't break existing scripts which depend on the current behavior. This PR just needs to extend that logic. Speaking for myself I would expect this patch to simply allow Here are a few concrete examples:
@FransUrbo did you have something different in mind? @DeHackEd would this be inline with your expectations? |
I tend to agree with @behlendorf, the best way to do this is to only disable all features if |
On Sep 21, 2016, at 8:34 PM, Brian Behlendorf wrote:
Initially I had, but this actually makes more sense. I'll rework the patch and finish the test script (which would be much simpler this way) as soon as I can. |
I'm struggling with trying to test a specific feature as disabled and all others enabled. How does this look:
Then something like this to run the tests:
|
943db61
to
2e83c4e
Compare
Updated the PR. Need to test these new changes. |
2e83c4e
to
c6704a1
Compare
Seems to be working just fine:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The existing test cases are failing because all the features are not enabled for the following command.
$ sudo ./cmd/zpool/zpool create -f -o feature@async_destroy=enabled tank vdb
$ sudo ./cmd/zpool/zpool get all tank | grep feature
tank feature@async_destroy disabled local
tank feature@empty_bpobj disabled local
tank feature@lz4_compress disabled local
tank feature@spacemap_histogram disabled local
tank feature@enabled_txg disabled local
tank feature@hole_birth disabled local
tank feature@extensible_dataset disabled local
tank feature@embedded_data disabled local
tank feature@bookmarks disabled local
tank feature@filesystem_limits disabled local
tank feature@large_blocks disabled local
tank feature@large_dnode disabled local
@@ -1,4 +1,4 @@ | |||
'\" te | |||
n'\" te |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stray 'n' character.
{ | ||
feature="${1}" | ||
feature_set=false | ||
other_feature_set=false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The scripts use the same formatting as the C. Tabs for indents and continued lines indented by 4 spaces.
c6704a1
to
2c0f2ef
Compare
Sometimes it is desired to specifically disable a feature directly on the 'zpool create' command line. Signed-off-by: Turbo Fredriksson turbo@bayour.com Closes openzfs#3460, openzfs#5142
2c0f2ef
to
9c9119d
Compare
I've been looking at the code for hours now, and I'm at a complete loss! I can't for the life of me remember what I was thinking/planning.. If someone have time/interest in taking a gander, I'd appreciate it. |
I may have cracked this, but can i even push my code in this PR or do i have to open a new one? |
@loli10K Open a new one. |
Superseded by #5324. |
Sometimes it is desired to specifically disable or enable a feature directly on the 'zpool create' command line.
If a disable have been specified, the default for all not mentioned features is 'enabled'.
If a enable have been specified, the default for all the not mentioned features is 'disabled'.
Signed-off-by: Turbo Fredriksson turbo@bayour.com
Closes #3460