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