mirror_zfs/man/man8
Serapheim Dimitropoulos 5b72a38d68 OpenZFS 8677 - Open-Context Channel Programs
Authored by: Serapheim Dimitropoulos <serapheim@delphix.com>
Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: Chris Williamson <chris.williamson@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Ported-by: Don Brady <don.brady@delphix.com>

We want to be able to run channel programs outside of synching
context. This would greatly improve performance for channel programs
that just gather information, as they won't have to wait for synching
context anymore.

=== What is implemented?

This feature introduces the following:
- A new command line flag in "zfs program" to specify our intention
  to run in open context. (The -n option)
- A new flag/option within the channel program ioctl which selects
  the context.
- Appropriate error handling whenever we try a channel program in
  open-context that contains zfs.sync* expressions.
- Documentation for the new feature in the manual pages.

=== How do we handle zfs.sync functions in open context?

When such a function is found by the interpreter and we are running
in open context we abort the script and we spit out a descriptive
runtime error. For example, given the script below ...

arg = ...
fs = arg["argv"][1]
err = zfs.sync.destroy(fs)
msg = "destroying " .. fs .. " err=" .. err
return msg

if we run it in open context, we will get back the following error:

Channel program execution failed:
[string "channel program"]:3: running functions from the zfs.sync
submodule requires passing sync=TRUE to lzc_channel_program()
(i.e. do not specify the "-n" command line argument)
stack traceback:
            [C]: in function 'destroy'
            [string "channel program"]:3: in main chunk

=== What about testing?

We've introduced new wrappers for all channel program tests that
run each channel program as both (startard & open-context) and
expect the appropriate behavior depending on the program using
the zfs.sync module.

OpenZFS-issue: https://www.illumos.org/issues/8677
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/17a49e15
Closes #6558
2018-02-08 16:05:57 -08:00
..
.gitignore Initial implementation of zed (ZFS Event Daemon) 2014-04-02 13:10:03 -07:00
fsck.zfs.8 Fix NAME section of manpages zhack and fsck.zfs. 2014-03-10 09:19:17 -07:00
Makefile.am OpenZFS 7431 - ZFS Channel Programs 2018-02-08 15:28:18 -08:00
mount.zfs.8 zfs.8 & mount.zfs.8: fix a few typos 2016-05-16 12:26:31 -07:00
vdev_id.8 vdev_id support for device link aliases 2012-12-03 14:04:47 -08:00
zdb.8 OpenZFS 8547 - update mandoc to 1.14.3 2017-08-24 10:30:42 -07:00
zed.8.in Update ZED copyright boilerplate 2015-05-11 15:07:00 -07:00
zfs-program.8 OpenZFS 8677 - Open-Context Channel Programs 2018-02-08 16:05:57 -08:00
zfs.8 OpenZFS 8677 - Open-Context Channel Programs 2018-02-08 16:05:57 -08:00
zgenhostid.8 Add mdoc style checker 2017-09-16 10:51:24 -07:00
zinject.8 Add corruption failure option to zinject(8) 2017-08-14 15:17:15 -07:00
zpool.8 zpool import -d to specify device path 2018-01-26 10:49:46 -08:00
zstreamdump.8 Add zstreamdump(8) command to examine ZFS send streams. 2012-09-02 14:54:27 -07:00