-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
zpool_influxdb: rewire under zpool command #11160
Conversation
Ah, the failing test is because the new help line exceeds 80 chars, going to fix that in a bit. |
e200838
to
2bbd9e2
Compare
The original `zpool_influxdb` name has polluted the usual command namespace available via common $PATH settings. This is really inconvenient for users who have things like `zpo<tab>status` in muscle memory. This change rewires the logic of said command under traditional `zpool` command, which already links with libzfs (and nothing else) + it doesn't do any calls to libzfs automatically. Signed-off-by: Pavel Snajdr <snajpa@snajpa.net>
2bbd9e2
to
1ab936c
Compare
I think this project misses the point of why zpool_influxdb exists. It also violates the UNIX philosophy https://en.wikipedia.org/wiki/Unix_philosophy Finally, zpool_influxdb nominally runs as a daemon. The zpool command is expressly intended to run interactively. The follow-on to zpool_influxdb is zpool_prometheus that runs as a daemon and provides an HTTP endpoint. This will be an even further divergence from the zpool command and keeping it as a daemon-only is a simpler path while following the UNIX philosophy. These are the reasons I did not provide a "influxdb-compatible" output extension for the zpool command. History lesson: several attempts have been made to generate easily parsable (JSON or similar) output for the zpool command. This is non-trivial because of the way the pool configuration is used internally in ZFS. I suppose if we had a fresh start, knowing what we know now, we'd use less C structs and more nvlists because the latter are easy to print as JSON. But going back and retrofitting the current ZFS to do so would be a massive undertaking, with little benefit. The simpler approach is to use /dev/zfs as the interface and provide small, purpose-built applications to use that interface. So the problem to be solved here, according to the OP, is one of fixing the shell completion rules. |
Well and I think that this argumentation for having a separate command (in a global command namespace no less) is rather weak, to say the least. If we're to follow the Unix philosophy, then I would love to see the following argumentation:
And finally, I would love to see the shell completion rule, which will enable this exact sequence again: Can I ask you to actually argue to the point and with concrete arguments? General philosophical comments don't seem to do much to help me understand a single bit of the motivation where are you actually coming from. Also, is it too much to ask for a constructive approach? I don't see you trying at all. Trying would be at least something along the lines of "okay, then lets rename it so it doesn't begin with |
I'm sure there is an equitable solution. Some comments,
This makes sense because zfs operates on datasets and zpool operates on pools. One of the original goals was to have a simple set of commands for humans. A ton of features has since been added, so one could argue, like the "ls has too many options", these have become too complicated.
Ah, for that there is a very good reason. Such a tool cannot be separated from the OpenZFS source because it relies on internals that are not externally available in the header files. It also uses unstable interfaces (libzfs) that are subject to change with every release -- and they do. So it is not possible to deliver such a tool separately from OpenZFS and have it actually work. Believe me, I tried that first. Corollary, the zfs and zpool commands compiled for one release are not expected to work on any other release.
Why do we have editors like vim, when all we need is cat? :-)
node_exporter (to which I also contribute) does not deliver zpool information, with a minor exception of a small subset on FreeBSD. You'll be happy to know that to date, the metrics information available from datasets is obtainable from node_exporter and telegraf (et.al.), so there is not plan AFAIK for a zfs_influxdb.
Where are these traditions documented? I see nothing in the contributing docs. Perhaps you can document them and add them? Meanwhile, back to the real problem. It seems your completion does not permit anyone to ever develop another command that begins with the letters "zpo" Am I correct? Is it really a simple task of renaming "zpool_influxdb" to something else? |
At the absolute core, yes. If we can agree to, say, It's not that there can't ever be another new binary with |
This is silly, but surely it is ok to rename. However, monitor is not quite right, I'd recommend Also, this implies you'll watch pull requests like a hawk in the future to make sure such things are caught early in review. |
Well... I thought the same thing about the current name and I'd bet if this got onto production systems, others would too. IMHO it shows, that we really need to get more people onto the -rc train, we need more testers :) The other idea I've had is, that we could install this into
I'm trying! But... I also have zillion of other duties... OpenZFS is just one of many components we need to look after to put together our vpsAdminOS - and it's still a community effort of 2.5 guys, so my time budget dedicatable to OpenZFS is very limited :( |
relocating to /usr/libexec has merit and would be the easiest solution |
Relocating it makes good sense to me, arguably that's where it always should have been installed. We already populate a |
It sounds like we've decided the way to handle this is to move it to |
Move zpool_influxdb to libexec dir, as per following discussions: openzfs#11156 openzfs#11160 Signed-off-by: Pavel Snajdr <snajpa@snajpa.net>
Move zpool_influxdb to libexec dir, as per following discussions: openzfs#11156 openzfs#11160 Signed-off-by: Pavel Snajdr <snajpa@snajpa.net>
Move zpool_influxdb to libexec dir, as per following discussions: openzfs#11156 openzfs#11160 Signed-off-by: Pavel Snajdr <snajpa@snajpa.net>
Move zpool_influxdb to libexec dir, as per following discussions: openzfs#11156 openzfs#11160 Signed-off-by: Pavel Snajdr <snajpa@snajpa.net>
Move zpool_influxdb to libexec dir, as per following discussions: openzfs#11156 openzfs#11160 Signed-off-by: Pavel Snajdr <snajpa@snajpa.net>
Move the zpool_influxdb command to /usr/libexec/zfs, and include the /usr/libexec/zfs path in the system search directory when running the test suite. Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Pavel Snajdr <snajpa@snajpa.net> Closes #11156 Closes #11160 Closes #11224
Move the zpool_influxdb command to /usr/libexec/zfs, and include the /usr/libexec/zfs path in the system search directory when running the test suite. Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Pavel Snajdr <snajpa@snajpa.net> Closes openzfs#11156 Closes openzfs#11160 Closes openzfs#11224
Move the zpool_influxdb command to /usr/libexec/zfs, and include the /usr/libexec/zfs path in the system search directory when running the test suite. Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Pavel Snajdr <snajpa@snajpa.net> Closes openzfs#11156 Closes openzfs#11160 Closes openzfs#11224
Move the zpool_influxdb command to /usr/libexec/zfs, and include the /usr/libexec/zfs path in the system search directory when running the test suite. Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Pavel Snajdr <snajpa@snajpa.net> Closes openzfs#11156 Closes openzfs#11160 Closes openzfs#11224
The original
zpool_influxdb
name has polluted the usual command namespaceavailable via common $PATH settings. This is really inconvenient for users
who have things like
zpo<tab>status
in muscle memory.This change rewires the logic of said command under traditional
zpool
command,which already links with libzfs (and nothing else) + it doesn't do any calls to
libzfs automatically.
Signed-off-by: Pavel Snajdr snajpa@snajpa.net
Motivation and Context
See #11156
How Has This Been Tested?
Locally, modified test is also passing.
Types of changes
Checklist:
Signed-off-by
.