Re:Understanding ZFS Channel Programs
by throwaway2048 on Thursday September 09, 2021 @01:35PM
(#28472352)
it seems pretty trivial to just have some kind of "begin/end atomic section" flag or function rather than jamming in a whole special purpose scripting enviroment.
Re:Understanding ZFS Channel Programs
by Hackbraten on Thursday September 09, 2021 @04:02PM
(#28474013)
But what is the API supposed to do when it comes across a `begin` flag? Stop all filesystem activity in all programs until yours sends the `end` flag? What if that flag never arrives, e.g. due to a bug in your client code?
Re:Understanding ZFS Channel Programs
by throwaway2048 on Friday September 10, 2021 @01:21AM
(#28478057)
delay all commits to disk until a fixed timeout is reached for command submission, if the timeout is reached the call returns failed, the same problem exists with this special purpose scripting environment just in other forms.
Re:Understanding ZFS Channel Programs
by infogulch on Thursday September 09, 2021 @02:30PM
(#28472987)
begin()
loop {}
Re:Understanding ZFS Channel Programs
by Hackbraten on Thursday September 09, 2021 @04:05PM
(#28474038)
> If the channel program exhausts an instruction or memory limit, a fatal error will be generated and the program will be stopped
1. Find the latest three snapshots, and then 2. delete those three snapshots.
With a generic API, that’d take two calls, with a possible TOCTOU in between so it wouldn’t be atomic.
But if you send that same program to the ZFS subsystem, and have it evaluate and execute the script, the subsystem would be able to guarantee atomicity, right?