1.\"
2.\" CDDL HEADER START
3.\"
4.\" The contents of this file are subject to the terms of the
5.\" Common Development and Distribution License (the "License").
6.\" You may not use this file except in compliance with the License.
7.\"
8.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9.\" or https://opensource.org/licenses/CDDL-1.0.
10.\" See the License for the specific language governing permissions
11.\" and limitations under the License.
12.\"
13.\" When distributing Covered Code, include this CDDL HEADER in each
14.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15.\" If applicable, add the following below this CDDL HEADER, with the
16.\" fields enclosed by brackets "[]" replaced with your own identifying
17.\" information: Portions Copyright [yyyy] [name of copyright owner]
18.\"
19.\" CDDL HEADER END
20.\"
21.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
22.\" Copyright (c) 2012, 2018 by Delphix. All rights reserved.
23.\" Copyright (c) 2012 Cyril Plisko. All Rights Reserved.
24.\" Copyright (c) 2017 Datto Inc.
25.\" Copyright (c) 2018 George Melikov. All Rights Reserved.
26.\" Copyright 2017 Nexenta Systems, Inc.
27.\" Copyright (c) 2017 Open-E, Inc. All Rights Reserved.
28.\"
29.Dd July 11, 2023
30.Dt ZPOOL-EVENTS 8
31.Os
32.
33.Sh NAME
34.Nm zpool-events
35.Nd list recent events generated by kernel
36.Sh SYNOPSIS
37.Nm zpool
38.Cm events
39.Op Fl vHf
40.Op Ar pool
41.Nm zpool
42.Cm events
43.Fl c
44.
45.Sh DESCRIPTION
46Lists all recent events generated by the ZFS kernel modules.
47These events are consumed by the
48.Xr zed 8
49and used to automate administrative tasks such as replacing a failed device
50with a hot spare.
51For more information about the subclasses and event payloads
52that can be generated see
53.Sx EVENTS
54and the following sections.
55.
56.Sh OPTIONS
57.Bl -tag -compact -width Ds
58.It Fl c
59Clear all previous events.
60.It Fl f
61Follow mode.
62.It Fl H
63Scripted mode.
64Do not display headers, and separate fields by a
65single tab instead of arbitrary space.
66.It Fl v
67Print the entire payload for each event.
68.El
69.
70.Sh EVENTS
71These are the different event subclasses.
72The full event name would be
73.Sy ereport.fs.zfs.\& Ns Em SUBCLASS ,
74but only the last part is listed here.
75.Pp
76.Bl -tag -compact -width "vdev.bad_guid_sum"
77.It Sy checksum
78Issued when a checksum error has been detected.
79.It Sy io
80Issued when there is an I/O error in a vdev in the pool.
81.It Sy data
82Issued when there have been data errors in the pool.
83.It Sy deadman
84Issued when an I/O request is determined to be "hung", this can be caused
85by lost completion events due to flaky hardware or drivers.
86See
87.Sy zfs_deadman_failmode
88in
89.Xr zfs 4
90for additional information regarding "hung" I/O detection and configuration.
91.It Sy delay
92Issued when a completed I/O request exceeds the maximum allowed time
93specified by the
94.Sy zio_slow_io_ms
95module parameter.
96This can be an indicator of problems with the underlying storage device.
97The number of delay events is ratelimited by the
98.Sy zfs_slow_io_events_per_second
99module parameter.
100.It Sy config
101Issued every time a vdev change have been done to the pool.
102.It Sy zpool
103Issued when a pool cannot be imported.
104.It Sy zpool.destroy
105Issued when a pool is destroyed.
106.It Sy zpool.export
107Issued when a pool is exported.
108.It Sy zpool.import
109Issued when a pool is imported.
110.It Sy zpool.reguid
111Issued when a REGUID (new unique identifier for the pool have been regenerated)
112have been detected.
113.It Sy vdev.unknown
114Issued when the vdev is unknown.
115Such as trying to clear device errors on a vdev that have failed/been kicked
116from the system/pool and is no longer available.
117.It Sy vdev.open_failed
118Issued when a vdev could not be opened (because it didn't exist for example).
119.It Sy vdev.corrupt_data
120Issued when corrupt data have been detected on a vdev.
121.It Sy vdev.no_replicas
122Issued when there are no more replicas to sustain the pool.
123This would lead to the pool being
124.Em DEGRADED .
125.It Sy vdev.bad_guid_sum
126Issued when a missing device in the pool have been detected.
127.It Sy vdev.too_small
128Issued when the system (kernel) have removed a device, and ZFS
129notices that the device isn't there any more.
130This is usually followed by a
131.Sy probe_failure
132event.
133.It Sy vdev.bad_label
134Issued when the label is OK but invalid.
135.It Sy vdev.bad_ashift
136Issued when the ashift alignment requirement has increased.
137.It Sy vdev.remove
138Issued when a vdev is detached from a mirror (or a spare detached from a
139vdev where it have been used to replace a failed drive - only works if
140the original drive have been re-added).
141.It Sy vdev.clear
142Issued when clearing device errors in a pool.
143Such as running
144.Nm zpool Cm clear
145on a device in the pool.
146.It Sy vdev.check
147Issued when a check to see if a given vdev could be opened is started.
148.It Sy vdev.spare
149Issued when a spare have kicked in to replace a failed device.
150.It Sy vdev.autoexpand
151Issued when a vdev can be automatically expanded.
152.It Sy io_failure
153Issued when there is an I/O failure in a vdev in the pool.
154.It Sy probe_failure
155Issued when a probe fails on a vdev.
156This would occur if a vdev
157have been kicked from the system outside of ZFS (such as the kernel
158have removed the device).
159.It Sy log_replay
160Issued when the intent log cannot be replayed.
161The can occur in the case of a missing or damaged log device.
162.It Sy resilver.start
163Issued when a resilver is started.
164.It Sy resilver.finish
165Issued when the running resilver have finished.
166.It Sy scrub.start
167Issued when a scrub is started on a pool.
168.It Sy scrub.finish
169Issued when a pool has finished scrubbing.
170.It Sy scrub.abort
171Issued when a scrub is aborted on a pool.
172.It Sy scrub.resume
173Issued when a scrub is resumed on a pool.
174.It Sy scrub.paused
175Issued when a scrub is paused on a pool.
176.It Sy bootfs.vdev.attach
177.El
178.
179.Sh PAYLOADS
180This is the payload (data, information) that accompanies an
181event.
182.Pp
183For
184.Xr zed 8 ,
185these are set to uppercase and prefixed with
186.Sy ZEVENT_ .
187.Pp
188.Bl -tag -compact -width "vdev_cksum_errors"
189.It Sy pool
190Pool name.
191.It Sy pool_failmode
192Failmode -
193.Sy wait ,
194.Sy continue ,
195or
196.Sy panic .
197See the
198.Sy failmode
199property in
200.Xr zpoolprops 7
201for more information.
202.It Sy pool_guid
203The GUID of the pool.
204.It Sy pool_context
205The load state for the pool (0=none, 1=open, 2=import, 3=tryimport, 4=recover
2065=error).
207.It Sy vdev_guid
208The GUID of the vdev in question (the vdev failing or operated upon with
209.Nm zpool Cm clear ,
210etc.).
211.It Sy vdev_type
212Type of vdev -
213.Sy disk ,
214.Sy file ,
215.Sy mirror ,
216etc.
217See the
218.Sy Virtual Devices
219section of
220.Xr zpoolconcepts 7
221for more information on possible values.
222.It Sy vdev_path
223Full path of the vdev, including any
224.Em -partX .
225.It Sy vdev_devid
226ID of vdev (if any).
227.It Sy vdev_fru
228Physical FRU location.
229.It Sy vdev_state
230State of vdev (0=uninitialized, 1=closed, 2=offline, 3=removed, 4=failed to
231open, 5=faulted, 6=degraded, 7=healthy).
232.It Sy vdev_ashift
233The ashift value of the vdev.
234.It Sy vdev_complete_ts
235The time the last I/O request completed for the specified vdev.
236.It Sy vdev_delta_ts
237The time since the last I/O request completed for the specified vdev.
238.It Sy vdev_spare_paths
239List of spares, including full path and any
240.Em -partX .
241.It Sy vdev_spare_guids
242GUID(s) of spares.
243.It Sy vdev_read_errors
244How many read errors that have been detected on the vdev.
245.It Sy vdev_write_errors
246How many write errors that have been detected on the vdev.
247.It Sy vdev_cksum_errors
248How many checksum errors that have been detected on the vdev.
249.It Sy parent_guid
250GUID of the vdev parent.
251.It Sy parent_type
252Type of parent.
253See
254.Sy vdev_type .
255.It Sy parent_path
256Path of the vdev parent (if any).
257.It Sy parent_devid
258ID of the vdev parent (if any).
259.It Sy zio_objset
260The object set number for a given I/O request.
261.It Sy zio_object
262The object number for a given I/O request.
263.It Sy zio_level
264The indirect level for the block.
265Level 0 is the lowest level and includes data blocks.
266Values > 0 indicate metadata blocks at the appropriate level.
267.It Sy zio_blkid
268The block ID for a given I/O request.
269.It Sy zio_err
270The error number for a failure when handling a given I/O request,
271compatible with
272.Xr errno 3
273with the value of
274.Sy EBADE
275used to indicate a ZFS checksum error.
276.It Sy zio_offset
277The offset in bytes of where to write the I/O request for the specified vdev.
278.It Sy zio_size
279The size in bytes of the I/O request.
280.It Sy zio_flags
281The current flags describing how the I/O request should be handled.
282See the
283.Sy I/O FLAGS
284section for the full list of I/O flags.
285.It Sy zio_stage
286The current stage of the I/O in the pipeline.
287See the
288.Sy I/O STAGES
289section for a full list of all the I/O stages.
290.It Sy zio_pipeline
291The valid pipeline stages for the I/O.
292See the
293.Sy I/O STAGES
294section for a full list of all the I/O stages.
295.It Sy zio_delay
296The time elapsed (in nanoseconds) waiting for the block layer to complete the
297I/O request.
298Unlike
299.Sy zio_delta ,
300this does not include any vdev queuing time and is
301therefore solely a measure of the block layer performance.
302.It Sy zio_timestamp
303The time when a given I/O request was submitted.
304.It Sy zio_delta
305The time required to service a given I/O request.
306.It Sy prev_state
307The previous state of the vdev.
308.It Sy cksum_algorithm
309Checksum algorithm used.
310See
311.Xr zfsprops 7
312for more information on the available checksum algorithms.
313.It Sy cksum_byteswap
314Whether or not the data is byteswapped.
315.It Sy bad_ranges
316.No [\& Ns Ar start , end )
317pairs of corruption offsets.
318Offsets are always aligned on a 64-bit boundary,
319and can include some gaps of non-corruption.
320(See
321.Sy bad_ranges_min_gap )
322.It Sy bad_ranges_min_gap
323In order to bound the size of the
324.Sy bad_ranges
325array, gaps of non-corruption
326less than or equal to
327.Sy bad_ranges_min_gap
328bytes have been merged with
329adjacent corruption.
330Always at least 8 bytes, since corruption is detected on a 64-bit word basis.
331.It Sy bad_range_sets
332This array has one element per range in
333.Sy bad_ranges .
334Each element contains
335the count of bits in that range which were clear in the good data and set
336in the bad data.
337.It Sy bad_range_clears
338This array has one element per range in
339.Sy bad_ranges .
340Each element contains
341the count of bits for that range which were set in the good data and clear in
342the bad data.
343.It Sy bad_set_bits
344If this field exists, it is an array of
345.Pq Ar bad data No & ~( Ns Ar good data ) ;
346that is, the bits set in the bad data which are cleared in the good data.
347Each element corresponds a byte whose offset is in a range in
348.Sy bad_ranges ,
349and the array is ordered by offset.
350Thus, the first element is the first byte in the first
351.Sy bad_ranges
352range, and the last element is the last byte in the last
353.Sy bad_ranges
354range.
355.It Sy bad_cleared_bits
356Like
357.Sy bad_set_bits ,
358but contains
359.Pq Ar good data No & ~( Ns Ar bad data ) ;
360that is, the bits set in the good data which are cleared in the bad data.
361.El
362.
363.Sh I/O STAGES
364The ZFS I/O pipeline is comprised of various stages which are defined below.
365The individual stages are used to construct these basic I/O
366operations: Read, Write, Free, Claim, and Ioctl.
367These stages may be
368set on an event to describe the life cycle of a given I/O request.
369.Pp
370.TS
371tab(:);
372l l l .
373Stage:Bit Mask:Operations
374_:_:_
375ZIO_STAGE_OPEN:0x00000001:RWFCI
376
377ZIO_STAGE_READ_BP_INIT:0x00000002:R----
378ZIO_STAGE_WRITE_BP_INIT:0x00000004:-W---
379ZIO_STAGE_FREE_BP_INIT:0x00000008:--F--
380ZIO_STAGE_ISSUE_ASYNC:0x00000010:RWF--
381ZIO_STAGE_WRITE_COMPRESS:0x00000020:-W---
382
383ZIO_STAGE_ENCRYPT:0x00000040:-W---
384ZIO_STAGE_CHECKSUM_GENERATE:0x00000080:-W---
385
386ZIO_STAGE_NOP_WRITE:0x00000100:-W---
387
388ZIO_STAGE_BRT_FREE:0x00000200:--F--
389
390ZIO_STAGE_DDT_READ_START:0x00000400:R----
391ZIO_STAGE_DDT_READ_DONE:0x00000800:R----
392ZIO_STAGE_DDT_WRITE:0x00001000:-W---
393ZIO_STAGE_DDT_FREE:0x00002000:--F--
394
395ZIO_STAGE_GANG_ASSEMBLE:0x00004000:RWFC-
396ZIO_STAGE_GANG_ISSUE:0x00008000:RWFC-
397
398ZIO_STAGE_DVA_THROTTLE:0x00010000:-W---
399ZIO_STAGE_DVA_ALLOCATE:0x00020000:-W---
400ZIO_STAGE_DVA_FREE:0x00040000:--F--
401ZIO_STAGE_DVA_CLAIM:0x00080000:---C-
402
403ZIO_STAGE_READY:0x00100000:RWFCI
404
405ZIO_STAGE_VDEV_IO_START:0x00200000:RW--I
406ZIO_STAGE_VDEV_IO_DONE:0x00400000:RW--I
407ZIO_STAGE_VDEV_IO_ASSESS:0x00800000:RW--I
408
409ZIO_STAGE_CHECKSUM_VERIFY:0x01000000:R----
410
411ZIO_STAGE_DONE:0x02000000:RWFCI
412.TE
413.
414.Sh I/O FLAGS
415Every I/O request in the pipeline contains a set of flags which describe its
416function and are used to govern its behavior.
417These flags will be set in an event as a
418.Sy zio_flags
419payload entry.
420.Pp
421.TS
422tab(:);
423l l .
424Flag:Bit Mask
425_:_
426ZIO_FLAG_DONT_AGGREGATE:0x00000001
427ZIO_FLAG_IO_REPAIR:0x00000002
428ZIO_FLAG_SELF_HEAL:0x00000004
429ZIO_FLAG_RESILVER:0x00000008
430ZIO_FLAG_SCRUB:0x00000010
431ZIO_FLAG_SCAN_THREAD:0x00000020
432ZIO_FLAG_PHYSICAL:0x00000040
433
434ZIO_FLAG_CANFAIL:0x00000080
435ZIO_FLAG_SPECULATIVE:0x00000100
436ZIO_FLAG_CONFIG_WRITER:0x00000200
437ZIO_FLAG_DONT_RETRY:0x00000400
438ZIO_FLAG_NODATA:0x00001000
439ZIO_FLAG_INDUCE_DAMAGE:0x00002000
440
441ZIO_FLAG_IO_ALLOCATING:0x00004000
442ZIO_FLAG_IO_RETRY:0x00008000
443ZIO_FLAG_PROBE:0x00010000
444ZIO_FLAG_TRYHARD:0x00020000
445ZIO_FLAG_OPTIONAL:0x00040000
446
447ZIO_FLAG_DONT_QUEUE:0x00080000
448ZIO_FLAG_DONT_PROPAGATE:0x00100000
449ZIO_FLAG_IO_BYPASS:0x00200000
450ZIO_FLAG_IO_REWRITE:0x00400000
451ZIO_FLAG_RAW_COMPRESS:0x00800000
452ZIO_FLAG_RAW_ENCRYPT:0x01000000
453
454ZIO_FLAG_GANG_CHILD:0x02000000
455ZIO_FLAG_DDT_CHILD:0x04000000
456ZIO_FLAG_GODFATHER:0x08000000
457ZIO_FLAG_NOPWRITE:0x10000000
458ZIO_FLAG_REEXECUTED:0x20000000
459ZIO_FLAG_DELEGATED:0x40000000
460ZIO_FLAG_FASTWRITE:0x80000000
461.TE
462.
463.Sh SEE ALSO
464.Xr zfs 4 ,
465.Xr zed 8 ,
466.Xr zpool-wait 8
467