forked from illumos/illumos-gate
-
Notifications
You must be signed in to change notification settings - Fork 109
/
disk.esc
208 lines (181 loc) · 7.1 KB
/
disk.esc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
*/
#pragma dictionary "DISK"
#define P disk
fru P;
asru P;
/*
* Over all comments for this file:
* <disk-as-detector> The disk-as-detector DE provides the mapping between
* ereports generated by a kernel disk driver sd(7D) and resulting faults.
*/
/*
* SERD engine for media error fault propagation:
*
* This strategy is designed to give a file system, like ZFS, the
* ability to attempt data recovery/relocation without faulting a disk.
* This implementation depends on a file system retry to the same lba
* to trigger a fault when recovery/relocation is not possible.
*
* We let the engine propagate one error only once every 1 minute and then if we
* still get 2 or more * errors within 24 hours for the same LBA, there is a fault.
*/
engine serd.io.scsi.cmd.disk.dev.rqs.merr@P, N=1, T=24h;
/*
* disk-as-detector: fault events.
*/
event fault.io.scsi.cmd.disk.dev.rqs.derr@P;
event fault.io.scsi.cmd.disk.dev.rqs.merr@P,
engine=serd.io.scsi.cmd.disk.dev.rqs.merr@P;
/*
* The uderr fault will be defined at some future time.
* event fault.io.scsi.cmd.disk.dev.uderr@P;
*/
/*
* disk-as-detector: upset events.
* NOTE: For now we define an upset to implement discard.
*/
event upset.io.scsi.cmd.disk.dev.rqs.derr@P;
event upset.io.scsi.cmd.disk.dev.rqs.merr@P;
event upset.io.scsi.cmd.disk.dev.uderr@P;
event upset.io.scsi.cmd.disk.dev.serr@P;
event upset.io.scsi.cmd.disk.tran@P;
event upset.io.scsi.cmd.disk.recovered@P;
/*
* disk-as-detector: ereports from the kernel.
*
* We don't know the topology for all scsi disks, but the kernel will always
* generate ereport telemetry assuming that we do. We define these ereports
* with 'discard_if_config_unknown=1', which permits ereports against things
* with unknown topology to be silently discarded. The ereport data is logged
* in either case, and can be viewed via 'fmdump -eV'.
*/
event ereport.io.scsi.cmd.disk.dev.rqs.derr@P, discard_if_config_unknown=1;
event ereport.io.scsi.cmd.disk.dev.rqs.merr@P, discard_if_config_unknown=1;
event ereport.io.scsi.cmd.disk.dev.serr@P, discard_if_config_unknown=1;
event ereport.io.scsi.cmd.disk.dev.uderr@P, discard_if_config_unknown=1;
event ereport.io.scsi.cmd.disk.recovered@P, discard_if_config_unknown=1;
event ereport.io.scsi.cmd.disk.tran@P, discard_if_config_unknown=1;
/*
* For some ereports we let the 'driver-assessment', communicated as part of
* the ereport payload, determine fault .vs. upset via propagation constraints.
*/
#define DRIVER_ASSESSMENT_FATAL \
(payloadprop_contains("driver-assessment", "fatal"))
#define DRIVER_ASSESSMENT_NONFATAL (!DRIVER_ASSESSMENT_FATAL)
/*
* disk-as-detector: propagations from faults(based on
* DRIVER_ASSESSMENT_FATAL).
* We need to set additional fault payloads to indicate fault details.
* The payload we may need are listed as following:
* fault.io.scsi.cmd.disk.dev.rqs.derr
* op_code, key, asc, ascq
* fault.io.scsi.cmd.disk.dev.rqs.merr
* op_code, key, asc, ascq, lba
*/
prop fault.io.scsi.cmd.disk.dev.rqs.derr@P->
ereport.io.scsi.cmd.disk.dev.rqs.derr@P{ DRIVER_ASSESSMENT_FATAL &&
setpayloadprop("key", payloadprop("key")) &&
setpayloadprop("asc", payloadprop("asc")) &&
setpayloadprop("ascq", payloadprop("ascq"))};
/*
* Utilize setserdsuffix with specific LBA,
* the serd engine would only trigger if the fault recurred on the same LBA
*/
prop fault.io.scsi.cmd.disk.dev.rqs.merr@P->
ereport.io.scsi.cmd.disk.dev.rqs.merr@P{ DRIVER_ASSESSMENT_FATAL &&
setserdsuffix(payloadprop("lba")) &&
setpayloadprop("key", payloadprop("key")) &&
setpayloadprop("asc", payloadprop("asc")) &&
setpayloadprop("ascq", payloadprop("ascq")) &&
setpayloadprop("lba", payloadprop("lba"))};
/*
* NOTE: this propagation uses the "may" propagation of eversholt.
* The ereport need never exist. It's just a way of making
* the diagnosis wait for the within time on that ereport
* to complete. Once it has completed the diagnosis continues
* even though the dummy ereport didn't occur.
*/
event ereport.io.scsi.cmd.disk.dev.rqs.merr.dummy@P {within(60s)};
prop fault.io.scsi.cmd.disk.dev.rqs.merr@P (0) ->
ereport.io.scsi.cmd.disk.dev.rqs.merr.dummy@P;
/*
* The uderr fault will be propagated at some future time.
* prop fault.io.scsi.cmd.disk.dev.uderr@P->
* ereport.io.scsi.cmd.disk.dev.uderr@P{ DRIVER_ASSESSMENT_FATAL };
*/
/*
* disk-as-detector: propagations from upsets(based on
* DRIVER_ASSESSMENT_NONFATAL).
*/
prop upset.io.scsi.cmd.disk.dev.rqs.derr@P->
ereport.io.scsi.cmd.disk.dev.rqs.derr@P{ DRIVER_ASSESSMENT_NONFATAL };
prop upset.io.scsi.cmd.disk.dev.rqs.merr@P->
ereport.io.scsi.cmd.disk.dev.rqs.merr@P{ DRIVER_ASSESSMENT_NONFATAL };
/*
* disk-as-detector: propagations from upsets(independent of
* driver-assessment)
*/
prop upset.io.scsi.cmd.disk.dev.serr@P->
ereport.io.scsi.cmd.disk.dev.serr@P;
prop upset.io.scsi.cmd.disk.dev.uderr@P->
ereport.io.scsi.cmd.disk.dev.uderr@P;
prop upset.io.scsi.cmd.disk.recovered@P->
ereport.io.scsi.cmd.disk.recovered@P;
prop upset.io.scsi.cmd.disk.tran@P->
ereport.io.scsi.cmd.disk.tran@P;
/*
* --------------------------------------
* The remainder of this file contains rules associated with the operation of
* cmd/fm/modules/common/disk-monitor/disk_monitor.c code.
*
* The disk DE provides a very simple 1-to-1 mapping between SCSI disk events
* generated by the disk-transport fmd module, and the resulting faults.
*/
/*
* Fault events.
*/
event fault.io.disk.over-temperature@P,
FITrate=10, FRU=P, ASRU=P;
event fault.io.disk.predictive-failure@P, FITrate=10,
FITrate=10, FRU=P, ASRU=P;
event fault.io.disk.self-test-failure@P, FITrate=10,
FITrate=10, FRU=P, ASRU=P;
/*
* ereports.
*/
event ereport.io.scsi.disk.over-temperature@P;
event ereport.io.scsi.disk.predictive-failure@P;
event ereport.io.scsi.disk.self-test-failure@P;
/*
* Propagations.
*/
prop fault.io.disk.over-temperature@P ->
ereport.io.scsi.disk.over-temperature@P;
prop fault.io.disk.self-test-failure@P ->
ereport.io.scsi.disk.self-test-failure@P;
prop fault.io.disk.predictive-failure@P ->
ereport.io.scsi.disk.predictive-failure@P {
setpayloadprop("asc", payloadprop("additional-sense-code")) &&
setpayloadprop("ascq", payloadprop("additional-sense-code-qualifier")) };