Whamcloud - gitweb
FIX: validation, ulink -> link
[doc/manual.git] / LustreTroubleshooting.xml
1 <?xml version='1.0' encoding='UTF-8'?>
2 <!-- This document was created with Syntext Serna Free. --><chapter xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" version="5.0" xml:lang="en-US" xml:id="lustretroubleshooting">
3   <info>
4     <title xml:id="lustretroubleshooting.title">Lustre Troubleshooting</title>
5   </info>
6   <para>This chapter provides information to troubleshoot Lustre, submit a Lustre bug, and Lustre performance tips. It includes the following sections:</para>
7   <itemizedlist>
8     <listitem>
9       <para><xref linkend="dbdoclet.50438198_11171"/></para>
10     </listitem>
11     <listitem>
12       <para><xref linkend="dbdoclet.50438198_30989"/></para>
13     </listitem>
14     <listitem>
15       <para><xref linkend="dbdoclet.50438198_93109"/></para>
16     </listitem>
17   </itemizedlist>
18   <section xml:id="dbdoclet.50438198_11171">
19     <title>26.1 Lustre Error Messages</title>
20     <para>Several resources are available to help troubleshoot Lustre. This section describes error numbers, error messages and logs.</para>
21     <section remap="h3">
22       <title>26.1.1 Error Numbers</title>
23       <para>Error numbers for Lustre come from the Linux errno.h, and are located in <literal>/usr/include/asm/errno.h</literal>. Lustre does not use all of the available Linux error numbers. The exact meaning of an error number depends on where it is used. Here is a summary of the basic errors that Lustre users may encounter.</para>
24       <informaltable frame="all">
25         <tgroup cols="3">
26           <colspec colname="c1" colwidth="33*"/>
27           <colspec colname="c2" colwidth="33*"/>
28           <colspec colname="c3" colwidth="33*"/>
29           <thead>
30             <row>
31               <entry>
32                 <para><emphasis role="bold">Error Number</emphasis></para>
33               </entry>
34               <entry>
35                 <para><emphasis role="bold">Error Name</emphasis></para>
36               </entry>
37               <entry>
38                 <para><emphasis role="bold">Description</emphasis></para>
39               </entry>
40             </row>
41           </thead>
42           <tbody>
43             <row>
44               <entry>
45                 <para> -1</para>
46               </entry>
47               <entry>
48                 <literal>
49                   <para> -EPERM</para>
50                 </literal>
51               </entry>
52               <entry>
53                 <para> Permission is denied.</para>
54               </entry>
55             </row>
56             <row>
57               <entry>
58                 <para> -2</para>
59               </entry>
60               <entry>
61                 <literal>
62                   <para> -ENOENT</para>
63                 </literal>
64               </entry>
65               <entry>
66                 <para> The requested file or directory does not exist.</para>
67               </entry>
68             </row>
69             <row>
70               <entry>
71                 <para> -4</para>
72               </entry>
73               <entry>
74                 <literal>
75                   <para> -EINTR</para>
76                 </literal>
77               </entry>
78               <entry>
79                 <para> The operation was interrupted (usually CTRL-C or a killing process).</para>
80               </entry>
81             </row>
82             <row>
83               <entry>
84                 <para> -5</para>
85               </entry>
86               <entry>
87                 <literal>
88                   <para> -EIO</para>
89                 </literal>
90               </entry>
91               <entry>
92                 <para> The operation failed with a read or write error.</para>
93               </entry>
94             </row>
95             <row>
96               <entry>
97                 <para> -19</para>
98               </entry>
99               <entry>
100                 <literal>
101                   <para> -ENODEV</para>
102                 </literal>
103               </entry>
104               <entry>
105                 <para> No such device is available. The server stopped or failed over.</para>
106               </entry>
107             </row>
108             <row>
109               <entry>
110                 <para> -22</para>
111               </entry>
112               <entry>
113                 <literal>
114                   <para> -EINVAL</para>
115                 </literal>
116               </entry>
117               <entry>
118                 <para> The parameter contains an invalid value.</para>
119               </entry>
120             </row>
121             <row>
122               <entry>
123                 <para> -28</para>
124               </entry>
125               <entry>
126                 <literal>
127                   <para> -ENOSPC</para>
128                 </literal>
129               </entry>
130               <entry>
131                 <para> The file system is out-of-space or out of inodes. Use <literal>lfs df</literal> (query the amount of file system space) or <literal>lfs df -i</literal> (query the number of inodes).</para>
132               </entry>
133             </row>
134             <row>
135               <entry>
136                 <para> -30</para>
137               </entry>
138               <entry>
139                 <literal>
140                   <para> -EROFS</para>
141                 </literal>
142               </entry>
143               <entry>
144                 <para> The file system is read-only, likely due to a detected error.</para>
145               </entry>
146             </row>
147             <row>
148               <entry>
149                 <para> -43</para>
150               </entry>
151               <entry>
152                 <literal>
153                   <para> -EIDRM</para>
154                 </literal>
155               </entry>
156               <entry>
157                 <para> The UID/GID does not match any known UID/GID on the MDS. Update etc/hosts and etc/group on the MDS to add the missing user or group.</para>
158               </entry>
159             </row>
160             <row>
161               <entry>
162                 <para> -107</para>
163               </entry>
164               <entry>
165                 <literal>
166                   <para> -ENOTCONN</para>
167                 </literal>
168               </entry>
169               <entry>
170                 <para> The client is not connected to this server.</para>
171               </entry>
172             </row>
173             <row>
174               <entry>
175                 <para> -110</para>
176               </entry>
177               <entry>
178                 <literal>
179                   <para> -ETIMEDOUT</para>
180                 </literal>
181               </entry>
182               <entry>
183                 <para> The operation took too long and timed out.</para>
184               </entry>
185             </row>
186           </tbody>
187         </tgroup>
188       </informaltable>
189     </section>
190     <section xml:id="dbdoclet.50438198_40669">
191       <title>26.1.2 Viewing Error Messages</title>
192       <para>As Lustre code runs on the kernel, single-digit error codes display to the application; these error codes are an indication of the problem. Refer to the kernel console log (dmesg) for all recent kernel messages from that node. On the node, <literal>/var/log/messages</literal> holds a log of all messages for at least the past day.</para>
193       <para>The error message initiates with &quot;LustreError&quot; in the console log and provides a short description of:</para>
194       <itemizedlist>
195         <listitem>
196           <para>What the problem is</para>
197         </listitem>
198         <listitem>
199           <para>Which process ID had trouble</para>
200         </listitem>
201         <listitem>
202           <para>Which server node it was communicating with, and so on.</para>
203         </listitem>
204       </itemizedlist>
205       <para>Lustre logs are dumped to <literal>/proc/sys/lnet/debug_pat</literal>h.</para>
206       <para>Collect the first group of messages related to a problem, and any messages that precede &quot;LBUG&quot; or &quot;assertion failure&quot; errors. Messages that mention server nodes (OST or MDS) are specific to that server; you must collect similar messages from the relevant server console logs.</para>
207       <para>Another Lustre debug log holds information for Lustre action for a short period of time which, in turn, depends on the processes on the node to use Lustre. Use the following command to extract debug logs on each of the nodes, run</para>
208       <screen>$ lctl dk &lt;filename&gt;
209 </screen>
210       <note>
211         <para>LBUG freezes the thread to allow capture of the panic stack. A system reboot is needed to clear the thread.</para>
212       </note>
213     </section>
214   </section>
215   <section xml:id="dbdoclet.50438198_30989">
216     <title>26.2 Reporting a Lustre Bug</title>
217     <para>If, after troubleshooting your Lustre system, you cannot resolve the problem, consider reporting a Lustre bug. The process for reporting a bug is described in the Lustre wiki topic <link xl:href="http://wiki.lustre.org/index.php/Reporting_Bugs">Reporting Bugs</link>.</para>
218     <para>You can also post a question to the <link xl:href="http://wiki.lustre.org/index.php/Lustre_Mailing_Lists">lustre-discuss mailing list</link> or search the <link xl:href="http://groups.google.com/group/lustre-discuss-list">lustre-discuss Archives</link> for information about your issue.</para>
219     <para>A Lustre diagnostics tool is available for downloading at: <link xl:href="http://downloads.lustre.org/public/tools/lustre-diagnostics/">http://downloads.lustre.org/public/tools/lustre-diagnostics/</link></para>
220     <para>You can run this tool to capture diagnostics output to include in the reported bug. To run this tool, enter one of these commands:</para>
221     <screen># lustre-diagnostics -t &lt;bugzilla bug #&gt;
222 # lustre-diagnostics.
223 </screen>
224     <para>Output is sent directly to the terminal. Use normal file redirection to send the output to a file, and then manually attach the file to the bug you are submitting.</para>
225   </section>
226   <section xml:id="dbdoclet.50438198_93109">
227     <title>26.3 Common Lustre Problems</title>
228     <para>This section describes how to address common issues encountered with Lustre.</para>
229     <section remap="h3">
230       <title>26.3.1 OST Object is Missing or Damaged</title>
231       <para>If the OSS fails to find an object or finds a damaged object, this message appears:</para>
232       <para><screen>OST object missing or damaged (OST &quot;ost1&quot;, object 98148, error -2)</screen></para>
233       <para>If the reported error is -2 (<literal>-ENOENT</literal>, or &quot;No such file or directory&quot;), then the object is missing. This can occur either because the MDS and OST are out of sync, or because an OST object was corrupted and deleted.</para>
234       <para>If you have recovered the file system from a disk failure by using e2fsck, then unrecoverable objects may have been deleted or moved to /lost+found on the raw OST partition. Because files on the MDS still reference these objects, attempts to access them produce this error.</para>
235       <para>If you have recovered a backup of the raw MDS or OST partition, then the restored partition is very likely to be out of sync with the rest of your cluster. No matter which server partition you restored from backup, files on the MDS may reference objects which no longer exist (or did not exist when the backup was taken); accessing those files produces this error.</para>
236       <para>If neither of those descriptions is applicable to your situation, then it is possible that you have discovered a programming error that allowed the servers to get out of sync. Please report this condition to the Lustre group, and we will investigate.</para>
237       <para>If the reported error is anything else (such as -5, &quot;<literal>I/O error</literal>&quot;), it likely indicates a storage failure. The low-level file system returns this error if it is unable to read from the storage device.</para>
238       <para><emphasis role="bold">Suggested Action</emphasis></para>
239       <para>If the reported error is -2, you can consider checking in <literal>/lost+found</literal> on your raw OST device, to see if the missing object is there. However, it is likely that this object is lost forever, and that the file that references the object is now partially or completely lost. Restore this file from backup, or salvage what you can and delete it.</para>
240       <para>If the reported error is anything else, then you should immediately inspect this server for storage problems.</para>
241     </section>
242     <section remap="h3">
243       <title>26.3.2 OSTs Become Read-Only</title>
244       <para>If the SCSI devices are inaccessible to Lustre at the block device level, then <literal>ldiskfs</literal> remounts the device read-only to prevent file system corruption. This is a normal behavior. The status in <literal>/proc/fs/lustre/health_check</literal> also shows &quot;not healthy&quot; on the affected nodes.</para>
245       <para>To determine what caused the &quot;not healthy&quot; condition:</para>
246       <itemizedlist>
247         <listitem>
248           <para>Examine the consoles of all servers for any error indications</para>
249         </listitem>
250         <listitem>
251           <para>Examine the syslogs of all servers for any LustreErrors or <literal>LBUG</literal></para>
252         </listitem>
253         <listitem>
254           <para>Check the health of your system hardware and network. (Are the disks working as expected, is the network dropping packets?)</para>
255         </listitem>
256         <listitem>
257           <para>Consider what was happening on the cluster at the time. Does this relate to a specific user workload or a system load condition? Is the condition reproducible? Does it happen at a specific time (day, week or month)?</para>
258         </listitem>
259       </itemizedlist>
260       <para>To recover from this problem, you must restart Lustre services using these file systems. There is no other way to know that the I/O made it to disk, and the state of the cache may be inconsistent with what is on disk.</para>
261     </section>
262     <section remap="h3">
263       <title>26.3.3 Identifying a Missing OST</title>
264       <para>If an OST is missing for any reason, you may need to know what files are affected. Although an OST is missing, the files system should be operational. From any mounted client node, generate a list of files that reside on the affected OST. It is advisable to mark the missing OST as &apos;unavailable&apos; so clients and the MDS do not time out trying to contact it.</para>
265       <orderedlist>
266         <listitem>
267           <para>Generate a list of devices and determine the OST&apos;s device number. Run:</para>
268           <screen>$ lctl dl </screen>
269           <para>The lctl dl command output lists the device name and number, along with the device UUID and the number of references on the device.</para>
270         </listitem>
271         <listitem>
272           <para>Deactivate the OST (on the OSS at the MDS). Run:</para>
273           <screen>$ lctl --device &lt;OST device name or number&gt; deactivate</screen>
274           <para>The OST device number or device name is generated by the lctl dl command.</para>
275           <para>The <literal>deactivate</literal> command prevents clients from creating new objects on the specified OST, although you can still access the OST for reading.</para>
276         </listitem>
277         <note>
278           <para>If the OST later becomes available it needs to be reactivated, run:</para>
279           <screen># lctl --device &lt;OST device name or number&gt; activate</screen>
280         </note>
281         <listitem>
282           <para>Determine all files that are striped over the missing OST, run:</para>
283           <screen># lfs getstripe -r -O {OST_UUID} /mountpoint</screen>
284           <para>This returns a simple list of filenames from the affected file system.</para>
285         </listitem>
286         <listitem>
287           <para>If necessary, you can read the valid parts of a striped file, run:</para>
288           <screen># dd if=filename of=new_filename bs=4k conv=sync,noerror</screen>
289         </listitem>
290         <listitem>
291           <para>You can delete these files with the unlink or munlink command.</para>
292           <screen># unlink|munlink filename {filename ...} </screen>
293         </listitem>
294         <note>
295           <para>There is no functional difference between the <literal>unlink</literal> and <literal>munlink</literal> commands. The unlink command is for newer Linux distributions. You can run <literal>munlink</literal> if <literal>unlink</literal> is not available.</para>
296           <para>When you run the <literal>unlink</literal> or <literal>munlink</literal> command, the file on the MDS is permanently removed.</para>
297         </note>
298         <listitem>
299           <para>If you need to know, specifically, which parts of the file are missing data, then you first need to determine the file layout (striping pattern), which includes the index of the missing OST). Run:</para>
300           <screen># lfs getstripe -v {filename}</screen>
301         </listitem>
302         <listitem>
303           <para>Use this computation is to determine which offsets in the file are affected: [(C*N + X)*S, (C*N + X)*S + S - 1], N = { 0, 1, 2, ...}</para>
304           <para>where:</para>
305           <para>C = stripe count</para>
306           <para>S = stripe size</para>
307           <para>X = index of bad OST for this file</para>
308         </listitem>
309       </orderedlist>
310       <para>For example, for a 2 stripe file, stripe size = 1M, the bad OST is at index 0, and you have holes in the file at: [(2*N + 0)*1M, (2*N + 0)*1M + 1M - 1], N = { 0, 1, 2, ...}</para>
311       <para>If the file system cannot be mounted, currently there is no way that parses metadata directly from an MDS. If the bad OST does not start, options to mount the file system are to provide a loop device OST in its place or replace it with a newly-formatted OST. In that case, the missing objects are created and are read as zero-filled.</para>
312     </section>
313     <section xml:id="dbdoclet.50438198_69657">
314       <title>26.3.4 Fixing a Bad LAST_ID on an OST</title>
315       <para>Each OST contains a LAST_ID file, which holds the last object (pre-)created by the MDS  <footnote>
316           <para>The contents of the LAST_ID file must be accurate regarding the actual objects that exist on the OST.</para>
317         </footnote>. The MDT contains a lov_objid file, with values that represent the last object the MDS has allocated to a file.</para>
318       <para>During normal operation, the MDT keeps some pre-created (but unallocated) objects on the OST, and the relationship between LAST_ID and lov_objid should be LAST_ID &lt;= lov_objid. Any difference in the file values results in objects being created on the OST when it next connects to the MDS. These objects are never actually allocated to a file, since they are of 0 length (empty), but they do no harm. Creating empty objects enables the OST to catch up to the MDS, so normal operations resume.</para>
319       <para>However, in the case where lov_objid &lt; LAST_ID, bad things can happen as the MDS is not aware of objects that have already been allocated on the OST, and it reallocates them to new files, overwriting their existing contents.</para>
320       <para>Here is the rule to avoid this scenario:</para>
321       <para>LAST_ID &gt;= lov_objid and LAST_ID == last_physical_object and lov_objid &gt;= last_used_object</para>
322       <para>Although the lov_objid value should be equal to the last_used_object value, the above rule suffices to keep Lustre happy at the expense of a few leaked objects.</para>
323       <para>In situations where there is on-disk corruption of the OST, for example caused by running with write cache enabled on the disks, the LAST_ID value may become inconsistent and result in a message similar to:</para>
324       <screen>&quot;filter_precreate()) HOME-OST0003: Serious error: 
325 objid 3478673 already exists; is this filesystem corrupt?&quot;</screen>
326       <para>A related situation may happen if there is a significant discrepancy between the record of previously-created objects on the OST and the previously-allocated objects on the MDS, for example if the MDS has been corrupted, or restored from backup, which may cause significant data loss if left unchecked. This produces a message like:</para>
327       <screen>&quot;HOME-OST0003: ignoring bogus orphan destroy request: 
328 obdid 3438673 last_id 3478673&quot;</screen>
329       <para>To recover from this situation, determine and set a reasonable LAST_ID value.</para>
330       <note>
331         <para>The file system must be stopped on all servers before performing this procedure.</para>
332       </note>
333       <para>For hex &lt; -&gt; decimal translations:</para>
334       <para>Use GDB:</para>
335       <screen>(gdb) p /x 15028
336 $2 = 0x3ab4</screen>
337       <para>Or <literal>bc</literal>:</para>
338       <screen>echo &quot;obase=16; 15028&quot; | bc</screen>
339       <orderedlist>
340         <listitem>
341           <para>Determine a reasonable value for the LAST_ID file. Check on the MDS:</para>
342           <screen># mount -t ldiskfs /dev/&lt;mdsdev&gt; /mnt/mds
343 # od -Ax -td8 /mnt/mds/lov_objid
344 </screen>
345           <para>There is one entry for each OST, in OST index order. This is what the MDS thinks is the last in-use object.</para>
346         </listitem>
347         <listitem>
348           <para>Determine the OST index for this OST.</para>
349           <screen># od -Ax -td4 /mnt/ost/last_rcvd
350 </screen>
351           <para>It will have it at offset 0x8c.</para>
352         </listitem>
353         <listitem>
354           <para>Check on the OST. Use debugfs to check the LAST_ID value:</para>
355           <screen>debugfs -c -R &apos;dump /O/0/LAST_ID /tmp/LAST_ID&apos; /dev/XXX ; od -Ax -td8 /tmp/\
356 LAST_ID&quot;
357 </screen>
358         </listitem>
359         <listitem>
360           <para>Check the objects on the OST:</para>
361           <screen>mount -rt ldiskfs /dev/{ostdev} /mnt/ost
362 # note the ls below is a number one and not a letter L
363 ls -1s /mnt/ost/O/0/d* | grep -v [a-z] |
364 sort -k2 -n &gt; /tmp/objects.{diskname}
365  
366 tail -30 /tmp/objects.{diskname}</screen>
367           <para>This shows you the OST state. There may be some pre-created orphans. Check for zero-length objects. Any zero-length objects with IDs higher than LAST_ID should be deleted. New objects will be pre-created.</para>
368         </listitem>
369       </orderedlist>
370       <para>If the OST LAST_ID value matches that for the objects existing on the OST, then it is possible the lov_objid file on the MDS is incorrect. Delete the lov_objid file on the MDS and it will be re-created from the LAST_ID on the OSTs.</para>
371       <para>If you determine the LAST_ID file on the OST is incorrect (that is, it does not match what objects exist, does not match the MDS lov_objid value), then you have decided on a proper value for LAST_ID.</para>
372       <para>Once you have decided on a proper value for LAST_ID, use this repair procedure.</para>
373       <orderedlist>
374         <listitem>
375           <para>Access:</para>
376           <screen>mount -t ldiskfs /dev/{ostdev} /mnt/ost</screen>
377         </listitem>
378         <listitem>
379           <para>Check the current:</para>
380           <screen>od -Ax -td8 /mnt/ost/O/0/LAST_ID</screen>
381         </listitem>
382         <listitem>
383           <para>Be very safe, only work on backups:</para>
384           <screen>cp /mnt/ost/O/0/LAST_ID /tmp/LAST_ID</screen>
385         </listitem>
386         <listitem>
387           <para>Convert binary to text:</para>
388           <screen>xxd /tmp/LAST_ID /tmp/LAST_ID.asc</screen>
389         </listitem>
390         <listitem>
391           <para>Fix:</para>
392           <screen>vi /tmp/LAST_ID.asc</screen>
393         </listitem>
394         <listitem>
395           <para>Convert to binary:</para>
396           <screen>xxd -r /tmp/LAST_ID.asc /tmp/LAST_ID.new</screen>
397         </listitem>
398         <listitem>
399           <para>Verify:</para>
400           <screen>od -Ax -td8 /tmp/LAST_ID.new</screen>
401         </listitem>
402         <listitem>
403           <para>Replace:</para>
404           <screen>cp /tmp/LAST_ID.new /mnt/ost/O/0/LAST_ID</screen>
405         </listitem>
406         <listitem>
407           <para>Clean up:</para>
408           <screen>umount /mnt/ost</screen>
409         </listitem>
410       </orderedlist>
411     </section>
412     <section remap="h3">
413       <title>26.3.5 Handling/Debugging &quot;<literal>Bind: Address already in use</literal>&quot; Error</title>
414       <para>During startup, Lustre may report a <literal>bind: Address already in use</literal> error and reject to start the operation. This is caused by a portmap service (often NFS locking) which starts before Lustre and binds to the default port 988. You must have port 988 open from firewall or IP tables for incoming connections on the client, OSS, and MDS nodes. LNET will create three outgoing connections on available, reserved ports to each client-server pair, starting with 1023, 1022 and 1021.</para>
415       <para>Unfortunately, you cannot set sunprc to avoid port 988. If you receive this error, do the following:</para>
416       <itemizedlist>
417         <listitem>
418           <para>Start Lustre before starting any service that uses sunrpc.</para>
419         </listitem>
420         <listitem>
421           <para>Use a port other than 988 for Lustre. This is configured in /etc/modprobe.conf as an option to the LNET module. For example:</para>
422           <screen>options lnet accept_port=988</screen>
423         </listitem>
424       </itemizedlist>
425       <itemizedlist>
426         <listitem>
427           <para>Add modprobe ptlrpc to your system startup scripts before the service that uses sunrpc. This causes Lustre to bind to port 988 and sunrpc to select a different port.</para>
428         </listitem>
429       </itemizedlist>
430       <note>
431         <para>You can also use the <literal>sysctl</literal> command to mitigate the NFS client from grabbing the Lustre service port. However, this is a partial workaround as other user-space RPC servers still have the ability to grab the port.</para>
432       </note>
433     </section>
434     <section remap="h3">
435       <title>26.3.6 Handling/Debugging Error &quot;- 28&quot;</title>
436       <para>A Linux error -28 (<literal>ENOSPC</literal>) that occurs during a write or sync operation indicates that an existing file residing on an OST could not be rewritten or updated because the OST was full, or nearly full. To verify if this is the case, on a client on which the OST is mounted, enter :</para>
437       <screen>lfs df -h</screen>
438       <para>To address this issue, you can do one of the following:</para>
439       <itemizedlist>
440         <listitem>
441           <para>Expand the disk space on the OST.</para>
442         </listitem>
443         <listitem>
444           <para>Copy or stripe the file to a less full OST.</para>
445         </listitem>
446       </itemizedlist>
447       <para>A Linux error -28 (<literal>ENOSPC</literal>) that occurs when a new file is being created may indicate that the MDS has run out of inodes and needs to be made larger. Newly created files do not written to full OSTs, while existing files continue to reside on the OST where they were initially created. To view inode information on the MDS, enter:</para>
448       <screen>lfs df -i</screen>
449       <para>Typically, Lustre reports this error to your application. If the application is checking the return code from its function calls, then it decodes it into a textual error message such as <literal>No space left on device</literal>. Both versions of the error message also appear in the system log.</para>
450       <para>For more information about the <literal>lfs df</literal> command, see <xref linkend="dbdoclet.50438209_35838">Checking File System Free Space</xref>.</para>
451       <para>Although it is less efficient, you can also use the grep command to determine which OST or MDS is running out of space. To check the free space and inodes on a client, enter:</para>
452       <screen>grep &apos;[0-9]&apos; /proc/fs/lustre/osc/*/kbytes{free,avail,total}
453 grep &apos;[0-9]&apos; /proc/fs/lustre/osc/*/files{free,total}
454 grep &apos;[0-9]&apos; /proc/fs/lustre/mdc/*/kbytes{free,avail,total}
455 grep &apos;[0-9]&apos; /proc/fs/lustre/mdc/*/files{free,total}</screen>
456       <note>
457         <para>You can find other numeric error codes along with a short name and text description in <literal>/usr/include/asm/errno.h</literal>.</para>
458       </note>
459     </section>
460     <section remap="h3">
461       <title>26.3.7 Triggering Watchdog for PID NNN</title>
462       <para>In some cases, a server node triggers a watchdog timer and this causes a process stack to be dumped to the console along with a Lustre kernel debug log being dumped into <literal>/tmp</literal> (by default). The presence of a watchdog timer does NOT mean that the thread OOPSed, but rather that it is taking longer time than expected to complete a given operation. In some cases, this situation is expected.</para>
463       <para>For example, if a RAID rebuild is really slowing down I/O on an OST, it might trigger watchdog timers to trip. But another message follows shortly thereafter, indicating that the thread in question has completed processing (after some number of seconds). Generally, this indicates a transient problem. In other cases, it may legitimately signal that a thread is stuck because of a software error (lock inversion, for example).</para>
464       <screen>Lustre: 0:0:(watchdog.c:122:lcw_cb()) </screen>
465       <para>The above message indicates that the watchdog is active for pid 933:</para>
466       <para>It was inactive for 100000ms:</para>
467       <screen>Lustre: 0:0:(linux-debug.c:132:portals_debug_dumpstack()) </screen>
468       <para>Showing stack for process:</para>
469       <screen>933 ll_ost_25     D F896071A     0   933      1    934   932 (L-TLB)
470 f6d87c60 00000046 00000000 f896071a f8def7cc 00002710 00001822 2da48cae
471 0008cf1a f6d7c220 f6d7c3d0 f6d86000 f3529648 f6d87cc4 f3529640 f8961d3d
472 00000010 f6d87c9c ca65a13c 00001fff 00000001 00000001 00000000 00000001</screen>
473       <para>Call trace:</para>
474       <screen>filter_do_bio+0x3dd/0xb90 [obdfilter]
475 default_wake_function+0x0/0x20
476 filter_direct_io+0x2fb/0x990 [obdfilter]
477 filter_preprw_read+0x5c5/0xe00 [obdfilter]
478 lustre_swab_niobuf_remote+0x0/0x30 [ptlrpc]
479 ost_brw_read+0x18df/0x2400 [ost]
480 ost_handle+0x14c2/0x42d0 [ost]
481 ptlrpc_server_handle_request+0x870/0x10b0 [ptlrpc]
482 ptlrpc_main+0x42e/0x7c0 [ptlrpc]
483 </screen>
484     </section>
485     <section remap="h3">
486       <title>26.3.8 Handling Timeouts on Initial Lustre Setup</title>
487       <para>If you come across timeouts or hangs on the initial setup of your Lustre system, verify that name resolution for servers and clients is working correctly. Some distributions configure <literal>/etc/hosts sts</literal> so the name of the local machine (as reported by the &apos;hostname&apos; command) is mapped to local host (127.0.0.1) instead of a proper IP address.</para>
488       <para>This might produce this error:</para>
489       <screen>LustreError:(ldlm_handle_cancel()) received cancel for unknown lock cookie
490 0xe74021a4b41b954e from nid 0x7f000001 (0:127.0.0.1)
491 </screen>
492     </section>
493     <section remap="h3">
494       <title>26.3.9 Handling/Debugging &quot;LustreError: xxx went back in time&quot;</title>
495       <para>Each time Lustre changes the state of the disk file system, it records a unique transaction number. Occasionally, when committing these transactions to the disk, the last committed transaction number displays to other nodes in the cluster to assist the recovery. Therefore, the promised transactions remain absolutely safe on the disappeared disk.</para>
496       <para>This situation arises when:</para>
497       <itemizedlist>
498         <listitem>
499           <para>You are using a disk device that claims to have data written to disk before it actually does, as in case of a device with a large cache. If that disk device crashes or loses power in a way that causes the loss of the cache, there can be a loss of transactions that you believe are committed. This is a very serious event, and you should run e2fsck against that storage before restarting Lustre.</para>
500         </listitem>
501         <listitem>
502           <para>As per the Lustre requirement, the shared storage used for failover is completely cache-coherent. This ensures that if one server takes over for another, it sees the most up-to-date and accurate copy of the data. In case of the failover of the server, if the shared storage does not provide cache coherency between all of its ports, then Lustre can produce an error.</para>
503         </listitem>
504       </itemizedlist>
505       <para>If you know the exact reason for the error, then it is safe to proceed with no further action. If you do not know the reason, then this is a serious issue and you should explore it with your disk vendor.</para>
506       <para>If the error occurs during failover, examine your disk cache settings. If it occurs after a restart without failover, try to determine how the disk can report that a write succeeded, then lose the Data Device corruption or Disk Errors.</para>
507     </section>
508     <section remap="h3">
509       <title>26.3.10 Lustre Error: &quot;<literal>Slow Start_Page_Write</literal>&quot;</title>
510       <para>The slow <literal>start_page_write</literal> message appears when the operation takes an extremely long time to allocate a batch of memory pages. Use these pages to receive network traffic first, and then write to disk.</para>
511     </section>
512     <section remap="h3">
513       <title>26.3.11 Drawbacks in Doing Multi-client O_APPEND Writes</title>
514       <para>It is possible to do multi-client <literal>O_APPEND</literal> writes to a single file, but there are few drawbacks that may make this a sub-optimal solution. These drawbacks are:</para>
515       <itemizedlist>
516         <listitem>
517           <para>  Each client needs to take an <literal>EOF</literal> lock on all the OSTs, as it is difficult to know which OST holds the end of the file until you check all the OSTs. As all the clients are using the same <literal>O_APPEND</literal>, there is significant locking overhead.</para>
518         </listitem>
519         <listitem>
520           <para> The second client cannot get all locks until the end of the writing of the first client, as the taking serializes all writes from the clients.</para>
521         </listitem>
522         <listitem>
523           <para> To avoid deadlocks, the taking of these locks occurs in a known, consistent order. As a client cannot know which OST holds the next piece of the file until the client has locks on all OSTS, there is a need of these locks in case of a striped file.</para>
524         </listitem>
525       </itemizedlist>
526     </section>
527     <section remap="h3">
528       <title>26.3.12 Slowdown Occurs During Lustre Startup</title>
529       <para>When Lustre starts, the Lustre file system needs to read in data from the disk. For the very first mdsrate run after the reboot, the MDS needs to wait on all the OSTs for object pre-creation. This causes a slowdown to occur when Lustre starts up.</para>
530       <para>After the file system has been running for some time, it contains more data in cache and hence, the variability caused by reading critical metadata from disk is mostly eliminated. The file system now reads data from the cache.</para>
531     </section>
532     <section remap="h3">
533       <title>26.3.13 Log Message <literal>&apos;Out of Memory</literal>&apos; on OST</title>
534       <para>When planning the hardware for an OSS node, consider the memory usage of several components in the Lustre system. If insufficient memory is available, an &apos;out of memory&apos; message can be logged.</para>
535       <para>During normal operation, several conditions indicate insufficient RAM on a server node:</para>
536       <itemizedlist>
537         <listitem>
538           <para> kernel &quot;<literal>Out of memory</literal>&quot; and/or &quot;<literal>oom-killer</literal>&quot; messages</para>
539         </listitem>
540         <listitem>
541           <para> Lustre &quot;<literal>kmalloc of &apos;mmm&apos; (NNNN bytes) failed...</literal>&quot; messages</para>
542         </listitem>
543         <listitem>
544           <para> Lustre or kernel stack traces showing processes stuck in &quot;<literal>try_to_free_pages</literal>&quot;</para>
545         </listitem>
546       </itemizedlist>
547       <para>For information on determining the MDS memory and OSS memory requirements, see <xref linkend="dbdoclet.50438256_26456">Determining Memory Requirements</xref>.</para>
548     </section>
549     <section remap="h3">
550       <title>26.3.14 Setting SCSI I/O Sizes</title>
551       <para>Some SCSI drivers default to a maximum I/O size that is too small for good Lustre performance. we have fixed quite a few drivers, but you may still find that some drivers give unsatisfactory performance with Lustre. As the default value is hard-coded, you need to recompile the drivers to change their default. On the other hand, some drivers may have a wrong default set.</para>
552       <para>If you suspect bad I/O performance and an analysis of Lustre statistics indicates that I/O is not 1 MB, check <literal>/sys/block/&lt;device&gt;/queue/max_sectors_kb</literal>. If the <literal>max_sectors_kb</literal> value is less than 1024, set it to at least 1024 to improve performance. If changing <literal>max_sectors_kb</literal> does not change the I/O size as reported by Lustre, you may want to examine the SCSI driver code.</para>
553     </section>
554   </section>
555 </chapter>