xref: /freebsd/sys/contrib/openzfs/man/man8/zpool-events.8 (revision d5b0e70f7e04d971691517ce1304d86a1e367e2e)
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 May 27, 2021
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) have been detected.
112.It Sy vdev.unknown
113Issued when the vdev is unknown.
114Such as trying to clear device errors on a vdev that have failed/been kicked
115from the system/pool and is no longer available.
116.It Sy vdev.open_failed
117Issued when a vdev could not be opened (because it didn't exist for example).
118.It Sy vdev.corrupt_data
119Issued when corrupt data have been detected on a vdev.
120.It Sy vdev.no_replicas
121Issued when there are no more replicas to sustain the pool.
122This would lead to the pool being
123.Em DEGRADED .
124.It Sy vdev.bad_guid_sum
125Issued when a missing device in the pool have been detected.
126.It Sy vdev.too_small
127Issued when the system (kernel) have removed a device, and ZFS
128notices that the device isn't there any more.
129This is usually followed by a
130.Sy probe_failure
131event.
132.It Sy vdev.bad_label
133Issued when the label is OK but invalid.
134.It Sy vdev.bad_ashift
135Issued when the ashift alignment requirement has increased.
136.It Sy vdev.remove
137Issued when a vdev is detached from a mirror (or a spare detached from a
138vdev where it have been used to replace a failed drive - only works if
139the original drive have been re-added).
140.It Sy vdev.clear
141Issued when clearing device errors in a pool.
142Such as running
143.Nm zpool Cm clear
144on a device in the pool.
145.It Sy vdev.check
146Issued when a check to see if a given vdev could be opened is started.
147.It Sy vdev.spare
148Issued when a spare have kicked in to replace a failed device.
149.It Sy vdev.autoexpand
150Issued when a vdev can be automatically expanded.
151.It Sy io_failure
152Issued when there is an I/O failure in a vdev in the pool.
153.It Sy probe_failure
154Issued when a probe fails on a vdev.
155This would occur if a vdev
156have been kicked from the system outside of ZFS (such as the kernel
157have removed the device).
158.It Sy log_replay
159Issued when the intent log cannot be replayed.
160The can occur in the case of a missing or damaged log device.
161.It Sy resilver.start
162Issued when a resilver is started.
163.It Sy resilver.finish
164Issued when the running resilver have finished.
165.It Sy scrub.start
166Issued when a scrub is started on a pool.
167.It Sy scrub.finish
168Issued when a pool has finished scrubbing.
169.It Sy scrub.abort
170Issued when a scrub is aborted on a pool.
171.It Sy scrub.resume
172Issued when a scrub is resumed on a pool.
173.It Sy scrub.paused
174Issued when a scrub is paused on a pool.
175.It Sy bootfs.vdev.attach
176.El
177.
178.Sh PAYLOADS
179This is the payload (data, information) that accompanies an
180event.
181.Pp
182For
183.Xr zed 8 ,
184these are set to uppercase and prefixed with
185.Sy ZEVENT_ .
186.Pp
187.Bl -tag -compact -width "vdev_cksum_errors"
188.It Sy pool
189Pool name.
190.It Sy pool_failmode
191Failmode -
192.Sy wait ,
193.Sy continue ,
194or
195.Sy panic .
196See the
197.Sy failmode
198property in
199.Xr zpoolprops 7
200for more information.
201.It Sy pool_guid
202The GUID of the pool.
203.It Sy pool_context
204The load state for the pool (0=none, 1=open, 2=import, 3=tryimport, 4=recover
2055=error).
206.It Sy vdev_guid
207The GUID of the vdev in question (the vdev failing or operated upon with
208.Nm zpool Cm clear ,
209etc.).
210.It Sy vdev_type
211Type of vdev -
212.Sy disk ,
213.Sy file ,
214.Sy mirror ,
215etc.
216See the
217.Sy Virtual Devices
218section of
219.Xr zpoolconcepts 7
220for more information on possible values.
221.It Sy vdev_path
222Full path of the vdev, including any
223.Em -partX .
224.It Sy vdev_devid
225ID of vdev (if any).
226.It Sy vdev_fru
227Physical FRU location.
228.It Sy vdev_state
229State of vdev (0=uninitialized, 1=closed, 2=offline, 3=removed, 4=failed to open, 5=faulted, 6=degraded, 7=healthy).
230.It Sy vdev_ashift
231The ashift value of the vdev.
232.It Sy vdev_complete_ts
233The time the last I/O request completed for the specified vdev.
234.It Sy vdev_delta_ts
235The time since the last I/O request completed for the specified vdev.
236.It Sy vdev_spare_paths
237List of spares, including full path and any
238.Em -partX .
239.It Sy vdev_spare_guids
240GUID(s) of spares.
241.It Sy vdev_read_errors
242How many read errors that have been detected on the vdev.
243.It Sy vdev_write_errors
244How many write errors that have been detected on the vdev.
245.It Sy vdev_cksum_errors
246How many checksum errors that have been detected on the vdev.
247.It Sy parent_guid
248GUID of the vdev parent.
249.It Sy parent_type
250Type of parent.
251See
252.Sy vdev_type .
253.It Sy parent_path
254Path of the vdev parent (if any).
255.It Sy parent_devid
256ID of the vdev parent (if any).
257.It Sy zio_objset
258The object set number for a given I/O request.
259.It Sy zio_object
260The object number for a given I/O request.
261.It Sy zio_level
262The indirect level for the block.
263Level 0 is the lowest level and includes data blocks.
264Values > 0 indicate metadata blocks at the appropriate level.
265.It Sy zio_blkid
266The block ID for a given I/O request.
267.It Sy zio_err
268The error number for a failure when handling a given I/O request,
269compatible with
270.Xr errno 3
271with the value of
272.Sy EBADE
273used to indicate a ZFS checksum error.
274.It Sy zio_offset
275The offset in bytes of where to write the I/O request for the specified vdev.
276.It Sy zio_size
277The size in bytes of the I/O request.
278.It Sy zio_flags
279The current flags describing how the I/O request should be handled.
280See the
281.Sy I/O FLAGS
282section for the full list of I/O flags.
283.It Sy zio_stage
284The current stage of the I/O in the pipeline.
285See the
286.Sy I/O STAGES
287section for a full list of all the I/O stages.
288.It Sy zio_pipeline
289The valid pipeline stages for the I/O.
290See the
291.Sy I/O STAGES
292section for a full list of all the I/O stages.
293.It Sy zio_delay
294The time elapsed (in nanoseconds) waiting for the block layer to complete the
295I/O request.
296Unlike
297.Sy zio_delta ,
298this does not include any vdev queuing time and is
299therefore solely a measure of the block layer performance.
300.It Sy zio_timestamp
301The time when a given I/O request was submitted.
302.It Sy zio_delta
303The time required to service a given I/O request.
304.It Sy prev_state
305The previous state of the vdev.
306.It Sy cksum_expected
307The expected checksum value for the block.
308.It Sy cksum_actual
309The actual checksum value for an errant block.
310.It Sy cksum_algorithm
311Checksum algorithm used.
312See
313.Xr zfsprops 7
314for more information on the available checksum algorithms.
315.It Sy cksum_byteswap
316Whether or not the data is byteswapped.
317.It Sy bad_ranges
318.No [\& Ns Ar start , end )
319pairs of corruption offsets.
320Offsets are always aligned on a 64-bit boundary,
321and can include some gaps of non-corruption.
322(See
323.Sy bad_ranges_min_gap )
324.It Sy bad_ranges_min_gap
325In order to bound the size of the
326.Sy bad_ranges
327array, gaps of non-corruption
328less than or equal to
329.Sy bad_ranges_min_gap
330bytes have been merged with
331adjacent corruption.
332Always at least 8 bytes, since corruption is detected on a 64-bit word basis.
333.It Sy bad_range_sets
334This array has one element per range in
335.Sy bad_ranges .
336Each element contains
337the count of bits in that range which were clear in the good data and set
338in the bad data.
339.It Sy bad_range_clears
340This array has one element per range in
341.Sy bad_ranges .
342Each element contains
343the count of bits for that range which were set in the good data and clear in
344the bad data.
345.It Sy bad_set_bits
346If this field exists, it is an array of
347.Pq Ar bad data No & ~( Ns Ar good data ) ;
348that is, the bits set in the bad data which are cleared in the good data.
349Each element corresponds a byte whose offset is in a range in
350.Sy bad_ranges ,
351and the array is ordered by offset.
352Thus, the first element is the first byte in the first
353.Sy bad_ranges
354range, and the last element is the last byte in the last
355.Sy bad_ranges
356range.
357.It Sy bad_cleared_bits
358Like
359.Sy bad_set_bits ,
360but contains
361.Pq Ar good data No & ~( Ns Ar bad data ) ;
362that is, the bits set in the good data which are cleared in the bad data.
363.It Sy bad_set_histogram
364If this field exists, it is an array of counters.
365Each entry counts bits set in a particular bit of a big-endian uint64 type.
366The first entry counts bits
367set in the high-order bit of the first byte, the 9th byte, etc, and the last
368entry counts bits set of the low-order bit of the 8th byte, the 16th byte, etc.
369This information is useful for observing a stuck bit in a parallel data path,
370such as IDE or parallel SCSI.
371.It Sy bad_cleared_histogram
372If this field exists, it is an array of counters.
373Each entry counts bit clears in a particular bit of a big-endian uint64 type.
374The first entry counts bits
375clears of the high-order bit of the first byte, the 9th byte, etc, and the
376last entry counts clears of the low-order bit of the 8th byte, the 16th byte, etc.
377This information is useful for observing a stuck bit in a parallel data
378path, such as IDE or parallel SCSI.
379.El
380.
381.Sh I/O STAGES
382The ZFS I/O pipeline is comprised of various stages which are defined below.
383The individual stages are used to construct these basic I/O
384operations: Read, Write, Free, Claim, and Ioctl.
385These stages may be
386set on an event to describe the life cycle of a given I/O request.
387.Pp
388.TS
389tab(:);
390l l l .
391Stage:Bit Mask:Operations
392_:_:_
393ZIO_STAGE_OPEN:0x00000001:RWFCI
394
395ZIO_STAGE_READ_BP_INIT:0x00000002:R----
396ZIO_STAGE_WRITE_BP_INIT:0x00000004:-W---
397ZIO_STAGE_FREE_BP_INIT:0x00000008:--F--
398ZIO_STAGE_ISSUE_ASYNC:0x00000010:RWF--
399ZIO_STAGE_WRITE_COMPRESS:0x00000020:-W---
400
401ZIO_STAGE_ENCRYPT:0x00000040:-W---
402ZIO_STAGE_CHECKSUM_GENERATE:0x00000080:-W---
403
404ZIO_STAGE_NOP_WRITE:0x00000100:-W---
405
406ZIO_STAGE_DDT_READ_START:0x00000200:R----
407ZIO_STAGE_DDT_READ_DONE:0x00000400:R----
408ZIO_STAGE_DDT_WRITE:0x00000800:-W---
409ZIO_STAGE_DDT_FREE:0x00001000:--F--
410
411ZIO_STAGE_GANG_ASSEMBLE:0x00002000:RWFC-
412ZIO_STAGE_GANG_ISSUE:0x00004000:RWFC-
413
414ZIO_STAGE_DVA_THROTTLE:0x00008000:-W---
415ZIO_STAGE_DVA_ALLOCATE:0x00010000:-W---
416ZIO_STAGE_DVA_FREE:0x00020000:--F--
417ZIO_STAGE_DVA_CLAIM:0x00040000:---C-
418
419ZIO_STAGE_READY:0x00080000:RWFCI
420
421ZIO_STAGE_VDEV_IO_START:0x00100000:RW--I
422ZIO_STAGE_VDEV_IO_DONE:0x00200000:RW--I
423ZIO_STAGE_VDEV_IO_ASSESS:0x00400000:RW--I
424
425ZIO_STAGE_CHECKSUM_VERIFY:0x00800000:R----
426
427ZIO_STAGE_DONE:0x01000000:RWFCI
428.TE
429.
430.Sh I/O FLAGS
431Every I/O request in the pipeline contains a set of flags which describe its
432function and are used to govern its behavior.
433These flags will be set in an event as a
434.Sy zio_flags
435payload entry.
436.Pp
437.TS
438tab(:);
439l l .
440Flag:Bit Mask
441_:_
442ZIO_FLAG_DONT_AGGREGATE:0x00000001
443ZIO_FLAG_IO_REPAIR:0x00000002
444ZIO_FLAG_SELF_HEAL:0x00000004
445ZIO_FLAG_RESILVER:0x00000008
446ZIO_FLAG_SCRUB:0x00000010
447ZIO_FLAG_SCAN_THREAD:0x00000020
448ZIO_FLAG_PHYSICAL:0x00000040
449
450ZIO_FLAG_CANFAIL:0x00000080
451ZIO_FLAG_SPECULATIVE:0x00000100
452ZIO_FLAG_CONFIG_WRITER:0x00000200
453ZIO_FLAG_DONT_RETRY:0x00000400
454ZIO_FLAG_DONT_CACHE:0x00000800
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