Whamcloud - gitweb
cf8d6630bd67667ee1df5b7e8715ea64e8080985
[doc/manual.git] / LustreTroubleshooting.xml
1 <?xml version='1.0' encoding='UTF-8'?>
2 <chapter xmlns="http://docbook.org/ns/docbook"
3  xmlns:xl="http://www.w3.org/1999/xlink" version="5.0" xml:lang="en-US"
4  xml:id="lustretroubleshooting">
5   <title xml:id="lustretroubleshooting.title">Lustre File System Troubleshooting</title>
6   <para>This chapter provides information about troubleshooting a Lustre file system, submitting a
7     bug to the Jira bug tracking system, and Lustre file system performance tips. It includes the
8     following sections:</para>
9   <itemizedlist>
10     <listitem>
11       <para><xref linkend="dbdoclet.50438198_11171"/></para>
12     </listitem>
13     <listitem>
14       <para><xref linkend="dbdoclet.reporting_lustre_problem"/></para>
15     </listitem>
16     <listitem>
17       <para><xref linkend="dbdoclet.50438198_93109"/></para>
18     </listitem>
19   </itemizedlist>
20   <section xml:id="dbdoclet.50438198_11171">
21       <title><indexterm><primary>troubleshooting</primary></indexterm>
22           <indexterm><primary>lustre</primary><secondary>troubleshooting</secondary><see>troubleshooting</see></indexterm>
23           <indexterm><primary>lustre</primary><secondary>errors</secondary><see>troubleshooting</see></indexterm>
24           <indexterm><primary>errors</primary><see>troubleshooting</see></indexterm>
25           Lustre Error Messages</title>
26     <para>Several resources are available to help troubleshoot an issue in a Lustre file system.
27       This section describes error numbers, error messages and logs.</para>
28     <section remap="h3">
29       <title><indexterm><primary>troubleshooting</primary><secondary>error numbers</secondary></indexterm>Error Numbers</title>
30       <para>Error numbers are generated by the Linux operating system and are located in
31           <literal>/usr/include/asm-generic/errno.h</literal>. The Lustre software does not use all
32         of the available Linux error numbers. The exact meaning of an error number depends on where
33         it is used. Here is a summary of the basic errors that Lustre file system users may
34         encounter.</para>
35       <informaltable frame="all">
36         <tgroup cols="3">
37           <colspec colname="c1" colwidth="33*"/>
38           <colspec colname="c2" colwidth="33*"/>
39           <colspec colname="c3" colwidth="33*"/>
40           <thead>
41             <row>
42               <entry>
43                 <para><emphasis role="bold">Error Number</emphasis></para>
44               </entry>
45               <entry>
46                 <para><emphasis role="bold">Error Name</emphasis></para>
47               </entry>
48               <entry>
49                 <para><emphasis role="bold">Description</emphasis></para>
50               </entry>
51             </row>
52           </thead>
53           <tbody>
54             <row>
55               <entry>
56                 <para> -1</para>
57               </entry>
58               <entry>
59                 <literal> -EPERM </literal>
60               </entry>
61               <entry>
62                 <para> Permission is denied.</para>
63               </entry>
64             </row>
65             <row>
66               <entry> -2 </entry>
67               <entry>
68                 <literal> -ENOENT </literal>
69               </entry>
70               <entry>
71                 <para> The requested file or directory does not exist.</para>
72               </entry>
73             </row>
74             <row>
75               <entry>
76                 <para> -4</para>
77               </entry>
78               <entry>
79                 <literal> -EINTR </literal>
80               </entry>
81               <entry>
82                 <para> The operation was interrupted (usually CTRL-C or a killing process).</para>
83               </entry>
84             </row>
85             <row>
86               <entry>
87                 <para> -5</para>
88               </entry>
89               <entry>
90                 <literal> -EIO </literal>
91               </entry>
92               <entry>
93                 <para> The operation failed with a read or write error.</para>
94               </entry>
95             </row>
96             <row>
97               <entry>
98                 <para> -19</para>
99               </entry>
100               <entry>
101                 <literal> -ENODEV </literal>
102               </entry>
103               <entry>
104                 <para> No such device is available. The server stopped or failed over.</para>
105               </entry>
106             </row>
107             <row>
108               <entry>
109                 <para> -22</para>
110               </entry>
111               <entry>
112                 <literal> -EINVAL </literal>
113               </entry>
114               <entry>
115                 <para> The parameter contains an invalid value.</para>
116               </entry>
117             </row>
118             <row>
119               <entry>
120                 <para> -28</para>
121               </entry>
122               <entry>
123                 <literal> -ENOSPC </literal>
124               </entry>
125               <entry>
126                 <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>
127               </entry>
128             </row>
129             <row>
130               <entry>
131                 <para> -30</para>
132               </entry>
133               <entry>
134                 <literal> -EROFS </literal>
135               </entry>
136               <entry>
137                 <para> The file system is read-only, likely due to a detected error.</para>
138               </entry>
139             </row>
140             <row>
141               <entry>
142                 <para> -43</para>
143               </entry>
144               <entry>
145                 <literal> -EIDRM </literal>
146               </entry>
147               <entry>
148                 <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>
149               </entry>
150             </row>
151             <row>
152               <entry>
153                 <para> -107</para>
154               </entry>
155               <entry>
156                 <literal> -ENOTCONN </literal>
157               </entry>
158               <entry>
159                 <para> The client is not connected to this server.</para>
160               </entry>
161             </row>
162             <row>
163               <entry>
164                 <para> -110</para>
165               </entry>
166               <entry>
167                 <literal> -ETIMEDOUT </literal>
168               </entry>
169               <entry>
170                 <para> The operation took too long and timed out.</para>
171               </entry>
172             </row>
173             <row>
174               <entry>
175                 <para> -122</para>
176               </entry>
177               <entry>
178                 <literal> -EDQUOT </literal>
179               </entry>
180               <entry>
181                 <para> The operation exceeded the user disk quota and was aborted.</para>
182               </entry>
183             </row>
184           </tbody>
185         </tgroup>
186       </informaltable>
187     </section>
188     <section xml:id="dbdoclet.50438198_40669">
189       <title><indexterm><primary>troubleshooting</primary><secondary>error messages</secondary></indexterm>Viewing Error Messages</title>
190       <para>As Lustre software code runs on the kernel, single-digit error codes display to the
191         application; these error codes are an indication of the problem. Refer to the kernel console
192         log (dmesg) for all recent kernel messages from that node. On the node,
193           <literal>/var/log/messages</literal> holds a log of all messages for at least the past
194         day.</para>
195       <para>The error message initiates with &quot;LustreError&quot; in the console log and provides a short description of:</para>
196       <itemizedlist>
197         <listitem>
198           <para>What the problem is</para>
199         </listitem>
200         <listitem>
201           <para>Which process ID had trouble</para>
202         </listitem>
203         <listitem>
204           <para>Which server node it was communicating with, and so on.</para>
205         </listitem>
206       </itemizedlist>
207       <para>Lustre logs are dumped to <literal>/proc/sys/lnet/debug_path</literal>.</para>
208       <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>
209       <para>Another Lustre debug log holds information for a short period of time for action by the
210         Lustre software, which, in turn, depends on the processes on the Lustre node. Use the
211         following command to extract debug logs on each of the nodes, run</para>
212       <screen>$ lctl dk <replaceable>filename</replaceable></screen>
213       <note>
214         <para>LBUG freezes the thread to allow capture of the panic stack. A system reboot is needed to clear the thread.</para>
215       </note>
216     </section>
217   </section>
218   <section xml:id="dbdoclet.reporting_lustre_problem">
219       <title><indexterm>
220         <primary>troubleshooting</primary>
221         <secondary>reporting bugs</secondary>
222       </indexterm><indexterm>
223         <primary>reporting bugs</primary>
224         <see>troubleshooting</see>
225       </indexterm>Reporting a Lustre File System Bug</title>
226     <para>If you cannot resolve a problem by troubleshooting your Lustre file
227       system, other options are:<itemizedlist>
228         <listitem>
229           <para>Post a question to the <link xmlns:xlink="http://www.w3.org/1999/xlink"
230               xlink:href="http://lists.lustre.org/listinfo.cgi/lustre-discuss-lustre.org">lustre-discuss</link>
231             email list or search the archives for information about your issue.</para>
232         </listitem>
233         <listitem>
234           <para>Submit a ticket to the <link xmlns:xlink="http://www.w3.org/1999/xlink"
235               xlink:href="https://jira.whamcloud.com/secure/Dashboard.jspa">Jira</link><abbrev><superscript>*</superscript></abbrev>
236            bug tracking and project management tool used for the Lustre project.
237            If you are a first-time user, you'll need to open an account by
238            clicking on <emphasis role="bold">Sign up</emphasis> on the
239            Welcome page.</para>
240         </listitem>
241       </itemizedlist> To submit a Jira ticket, follow these steps:<orderedlist>
242         <listitem>
243           <para>To avoid filing a duplicate ticket, search for existing
244             tickets for your issue.
245             <emphasis role="italic">For search tips, see
246             <xref xmlns:xlink="http://www.w3.org/1999/xlink"
247               linkend="dbdoclet.searching_jira"/>.</emphasis></para>
248         </listitem>
249         <listitem>
250           <para>To create a ticket, click <emphasis role="bold">+Create Issue</emphasis> in the
251             upper right corner. <emphasis role="italic">Create a separate ticket for each issue you
252               wish to submit.</emphasis></para>
253         </listitem>
254         <listitem>
255           <para>In the form displayed, enter the following information:<itemizedlist>
256               <listitem>
257                 <para><emphasis role="italic">Project</emphasis> - Select <emphasis role="bold"
258                     >Lustre</emphasis> or <emphasis role="bold">Lustre Documentation</emphasis> or
259                   an appropriate project.</para>
260               </listitem>
261               <listitem>
262                 <para><emphasis role="italic">Issue type</emphasis> - Select <emphasis role="bold"
263                     >Bug</emphasis>.</para>
264               </listitem>
265               <listitem>
266                 <para><emphasis role="italic">Summary</emphasis> - Enter a short description of the
267                   issue. Use terms that would be useful for someone searching for a similar issue. A
268                   LustreError or ASSERT/panic message often makes a good summary.</para>
269               </listitem>
270               <listitem>
271                 <para><emphasis role="italic">Affects version(s)</emphasis> - Select your Lustre
272                   release.</para>
273               </listitem>
274               <listitem>
275                 <para><emphasis role="italic">Environment</emphasis> - Enter your kernel with
276                   version number.</para>
277               </listitem>
278               <listitem>
279                 <para><emphasis role="italic">Description</emphasis> - Include a detailed
280                   description of <emphasis role="italic">visible symptoms</emphasis> and, if
281                   possible, <emphasis role="italic">how the problem is produced</emphasis>. Other
282                   useful information may include <emphasis role="italic">the behavior you expect to
283                     see</emphasis> and <emphasis role="italic">what you have tried so far to
284                     diagnose the problem</emphasis>.</para>
285               </listitem>
286               <listitem>
287                 <para><emphasis role="italic">Attachments</emphasis> - Attach log sources such as
288                   Lustre debug log dumps (see <xref xmlns:xlink="http://www.w3.org/1999/xlink"
289                     linkend="dbdoclet.50438274_15874"/>), syslogs, or console logs. <emphasis
290                     role="italic"><emphasis role="bold">Note:</emphasis></emphasis> Lustre debug
291                   logs must be processed using <code>lctl df</code> prior to attaching to a Jira
292                   ticket. For more information, see <xref xmlns:xlink="http://www.w3.org/1999/xlink"
293                     linkend="dbdoclet.50438274_62472"/>. </para>
294               </listitem>
295             </itemizedlist>Other fields in the form are used for project tracking and are irrelevant
296             to reporting an issue. You can leave these in their default state.</para>
297         </listitem>
298       </orderedlist></para>
299     <section xml:id="dbdoclet.searching_jira">
300       <title>Searching Jira<superscript>*</superscript>for Duplicate Tickets</title>
301       <para>Before submitting a ticket, always search the Jira bug tracker for
302         an existing ticket for your issue.  This avoids duplicating effort and
303         may immediately provide you with a solution to your problem. </para>
304       <para>To do a search in the Jira bug tracker, select the
305         <emphasis role="bold">Issues</emphasis> tab and click on
306         <emphasis role="bold">New filter</emphasis>. Use the filters provided
307         to select criteria for your search. To search for specific text, enter
308         the text in the "Contains text" field and click the magnifying glass
309         icon.</para>
310       <para>When searching for text such as an ASSERTION or LustreError
311         message, you can remove NIDs, pointers, and other installation-specific
312         and possibly version-specific text from your search string such as line
313         numbers by following the example below.</para>
314       <para><emphasis role="italic">Original error message:</emphasis></para>
315       <para><code>"(filter_io_26.c:</code>
316         <emphasis role="bold">791</emphasis><code>:filter_commitrw_write())
317         ASSERTION(oti-&gt;oti_transno&lt;=obd-&gt;obd_last_committed) failed:
318         oti_transno </code><emphasis role="bold">752</emphasis>
319         <code>last_committed </code><emphasis role="bold">750</emphasis>
320         <code>"</code></para>
321       <para><emphasis role="italic">Optimized search string</emphasis></para>
322       <para><code>filter_commitrw_write ASSERTION oti_transno
323         obd_last_committed failed:</code></para>
324     </section>
325   </section>
326   <section xml:id="dbdoclet.50438198_93109">
327     <title><indexterm>
328         <primary>troubleshooting</primary>
329         <secondary>common problems</secondary>
330       </indexterm>Common Lustre File System Problems</title>
331     <para>This section describes how to address common issues encountered with
332       a Lustre file system.</para>
333     <section remap="h3">
334       <title>OST Object is Missing or Damaged</title>
335       <para>If the OSS fails to find an object or finds a damaged object,
336         this message appears:</para>
337       <para><screen>OST object missing or damaged (OST &quot;ost1&quot;, object 98148, error -2)</screen></para>
338       <para>If the reported error is -2 (<literal>-ENOENT</literal>, or
339         &quot;No such file or directory&quot;), then the object is no longer
340         present on the OST, even though a file on the MDT is referencing it.
341         This can occur either because the MDT and OST are out of sync, or
342         because an OST object was corrupted and deleted by e2fsck.</para>
343       <para>If you have recovered the file system from a disk failure by using
344         e2fsck, then unrecoverable objects may have been deleted or moved to
345         /lost+found in the underlying OST filesystem. Because files on the MDT
346         still reference these objects, attempts to access them produce this
347         error.</para>
348       <para>If you have restored the filesystem from a backup of the raw MDT
349         or OST partition, then the restored partition is very likely to be out
350         of sync with the rest of your cluster. No matter which server partition
351         you restored from backup, files on the MDT may reference objects which
352         no longer exist (or did not exist when the backup was taken); accessing
353         those files produces this error.</para>
354       <para>If neither of those descriptions is applicable to your situation,
355         then it is possible that you have discovered a programming error that
356         allowed the servers to get out of sync.
357         Please submit a Jira ticket (see <xref xmlns:xlink="http://www.w3.org/1999/xlink"
358           linkend="dbdoclet.reporting_lustre_problem"/>).</para>
359       <para>If the reported error is anything else (such as -5,
360       &quot;<literal>I/O error</literal>&quot;), it likely indicates a storage
361       device failure. The low-level file system returns this error if it is
362       unable to read from the storage device.</para>
363       <para><emphasis role="bold">Suggested Action</emphasis></para>
364       <para>If the reported error is -2, you can consider checking in
365         <literal>lost+found/</literal> on your raw OST device, to see if the
366         missing object is there. However, it is likely that this object is
367         lost forever, and that the file that references the object is now
368         partially or completely lost. Restore this file from backup, or
369         salvage what you can using <literal>dd conv=noerror</literal>and
370         delete it using the <literal>unlink</literal> command.</para>
371       <para>If the reported error is anything else, then you should
372         immediately inspect this server for storage problems.</para>
373     </section>
374     <section remap="h3">
375       <title>OSTs Become Read-Only</title>
376       <para>If the SCSI devices are inaccessible to the Lustre file system
377         at the block device level, then <literal>ldiskfs</literal> remounts
378         the device read-only to prevent file system corruption. This is a normal
379         behavior. The status in <literal>/proc/fs/lustre/health_check</literal>
380         also shows &quot;not healthy&quot; on the affected nodes.</para>
381       <para>To determine what caused the &quot;not healthy&quot; condition:</para>
382       <itemizedlist>
383         <listitem>
384           <para>Examine the consoles of all servers for any error indications</para>
385         </listitem>
386         <listitem>
387           <para>Examine the syslogs of all servers for any LustreErrors or <literal>LBUG</literal></para>
388         </listitem>
389         <listitem>
390           <para>Check the health of your system hardware and network. (Are the disks working as expected, is the network dropping packets?)</para>
391         </listitem>
392         <listitem>
393           <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>
394         </listitem>
395       </itemizedlist>
396       <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>
397     </section>
398     <section remap="h3">
399       <title>Identifying a Missing OST</title>
400       <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>
401       <orderedlist>
402         <listitem>
403           <para>Generate a list of devices and determine the OST&apos;s device number. Run:</para>
404           <screen>$ lctl dl </screen>
405           <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>
406         </listitem>
407         <listitem>
408           <para>Deactivate the OST (on the OSS at the MDS). Run:</para>
409           <screen>$ lctl --device <replaceable>lustre_device_number</replaceable> deactivate</screen>
410           <para>The OST device number or device name is generated by the lctl dl command.</para>
411           <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>
412           <note>
413             <para>If the OST later becomes available it needs to be reactivated, run:</para>
414             <screen># lctl --device <replaceable>lustre_device_number</replaceable> activate</screen>
415           </note>
416         </listitem>
417         <listitem>
418           <para>Determine all files that are striped over the missing OST, run:</para>
419           <screen># lfs find -O {OST_UUID} /mountpoint</screen>
420           <para>This returns a simple list of filenames from the affected file system.</para>
421         </listitem>
422         <listitem>
423           <para>If necessary, you can read the valid parts of a striped file, run:</para>
424           <screen># dd if=filename of=new_filename bs=4k conv=sync,noerror</screen>
425         </listitem>
426         <listitem>
427           <para>You can delete these files with the <literal>unlink</literal> command.</para>
428           <screen># unlink filename {filename ...} </screen>
429           <note>
430             <para>When you run the <literal>unlink</literal> command, it may
431               return an error that the file could not be found, but the file
432               on the MDS has been permanently removed.</para>
433           </note>
434         </listitem>
435       </orderedlist>
436       <para>If the file system cannot be mounted, currently there is no way
437         that parses metadata directly from an MDS. If the bad OST does not
438         start, options to mount the file system are to provide a loop device
439         OST in its place or replace it with a newly-formatted OST. In that case,
440         the missing objects are created and are read as zero-filled.</para>
441     </section>
442     <section xml:id="dbdoclet.repair_ost_lastid">
443       <title>Fixing a Bad LAST_ID on an OST</title>
444       <para>Each OST contains a <literal>LAST_ID</literal> file, which holds
445         the last object (pre-)created by the MDS
446         <footnote><para>The contents of the <literal>LAST_ID</literal>
447           file must be accurate regarding the actual objects that exist
448           on the OST.</para></footnote>.
449         The MDT contains a <literal>lov_objid</literal> file, with values
450         that represent the last object the MDS has allocated to a file.</para>
451       <para>During normal operation, the MDT keeps pre-created (but unused)
452         objects on the OST, and normally <literal>LAST_ID</literal> should be
453         larger than <literal>lov_objid</literal>.  Any small difference in the
454         values is a result of objects being precreated on the OST to improve
455         MDS file creation performance. These precreated objects are not yet
456         allocated to a file, since they are of zero length (empty).</para>
457       <para>However, in the case where <literal>lov_objid</literal> is
458         larger than <literal>LAST_ID</literal>, it indicates the MDS has
459         allocated objects to files that do not exist on the OST.  Conversely,
460         if <literal>lov_objid</literal> is significantly less than
461         <literal>LAST_ID</literal> (by at least 20,000 objects) it indicates
462         the OST previously allocated objects at the request of the MDS (which
463         likely contain data) but it doesn't know about them.</para>
464       <para condition='l25'>Since Lustre 2.5 the MDS and OSS will resync the
465         <literal>lov_objid</literal> and <literal>LAST_ID</literal> files
466         automatically if they become out of sync.  This may result in some
467         space on the OSTs becoming unavailable until LFSCK is next run, but
468         avoids issues with mounting the filesystem.</para>
469       <para condition='l26'>Since Lustre 2.6 the LFSCK will repair the
470         <literal>LAST_ID</literal> file on the OST automatically based on
471         the objects that exist on the OST, in case it was corrupted.</para>
472       <para>In situations where there is on-disk corruption of the OST, for
473         example caused by the disk write cache being lost, or if the OST
474         was restored from an old backup or reformatted, the
475         <literal>LAST_ID</literal> value may become inconsistent and result
476         in a message similar to:</para>
477       <screen>&quot;myth-OST0002: Too many FIDs to precreate,
478 OST replaced or reformatted: LFSCK will clean up&quot;</screen>
479       <para>A related situation may happen if there is a significant
480         discrepancy between the record of previously-created objects on the
481         OST and the previously-allocated objects on the MDT, for example if
482         the MDT has been corrupted, or restored from backup, which would cause
483         significant data loss if left unchecked. This produces a message
484         like:</para>
485       <screen>&quot;myth-OST0002: too large difference between
486 MDS LAST_ID [0x1000200000000:0x100048:0x0] (1048648) and
487 OST LAST_ID [0x1000200000000:0x2232123:0x0] (35856675), trust the OST&quot;</screen>
488       <para>In such cases, the MDS will advance the <literal>lov_objid</literal>
489         value to match that of the OST to avoid deleting existing objects,
490         which may contain data.  Files on the MDT that reference these objects
491         will not be lost.  Any unreferenced OST objects will be attached to
492         the <literal>.lustre/lost+found</literal> directory the next time
493         LFSCK <literal>layout</literal> check is run.</para>
494     </section>
495     <section remap="h3">
496       <title><indexterm><primary>troubleshooting</primary><secondary>'Address already in use'</secondary></indexterm>Handling/Debugging &quot;<literal>Bind: Address already in use</literal>&quot; Error</title>
497       <para>During startup, the Lustre software may report a <literal>bind: Address already in
498           use</literal> error and reject to start the operation. This is caused by a portmap service
499         (often NFS locking) that starts before the Lustre file system and binds to the default port
500         988. You must have port 988 open from firewall or IP tables for incoming connections on the
501         client, OSS, and MDS nodes. LNet will create three outgoing connections on available,
502         reserved ports to each client-server pair, starting with 1023, 1022 and 1021.</para>
503       <para>Unfortunately, you cannot set sunprc to avoid port 988. If you receive this error, do the following:</para>
504       <itemizedlist>
505         <listitem>
506           <para>Start the Lustre file system before starting any service that uses sunrpc.</para>
507         </listitem>
508         <listitem>
509           <para>Use a port other than 988 for the Lustre file system. This is configured in
510               <literal>/etc/modprobe.d/lustre.conf</literal> as an option to the LNet module. For
511             example:</para>
512           <screen>options lnet accept_port=988</screen>
513         </listitem>
514       </itemizedlist>
515       <itemizedlist>
516         <listitem>
517           <para>Add modprobe ptlrpc to your system startup scripts before the service that uses
518             sunrpc. This causes the Lustre file system to bind to port 988 and sunrpc to select a
519             different port.</para>
520         </listitem>
521       </itemizedlist>
522       <note>
523         <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>
524       </note>
525     </section>
526     <section remap="h3">
527       <title><indexterm><primary>troubleshooting</primary><secondary>'Error -28'</secondary></indexterm>Handling/Debugging Error &quot;- 28&quot;</title>
528       <para>A Linux error -28 (<literal>ENOSPC</literal>) that occurs during
529         a write or sync operation indicates that an existing file residing
530         on an OST could not be rewritten or updated because the OST was full,
531         or nearly full. To verify if this is the case, run on a client:</para>
532         <screen>
533 client$ lfs df -h
534 UUID                       bytes        Used   Available Use% Mounted on
535 myth-MDT0000_UUID          12.9G        1.5G       10.6G  12% /myth[MDT:0]
536 myth-OST0000_UUID           3.6T        3.1T      388.9G  89% /myth[OST:0]
537 myth-OST0001_UUID           3.6T        3.6T       64.0K 100% /myth[OST:1]
538 myth-OST0002_UUID           3.6T        3.1T      394.6G  89% /myth[OST:2]
539 myth-OST0003_UUID           5.4T        5.0T      267.8G  95% /myth[OST:3]
540 myth-OST0004_UUID           5.4T        2.9T        2.2T  57% /myth[OST:4]
541
542 filesystem_summary:        21.6T       17.8T        3.2T  85% /myth
543         </screen>
544       <para>To address this issue, you can expand the disk space on the OST,
545           or use the <literal>lfs_migrate</literal> command to migrate (move)
546           files to a less full OST.  For details on both of these options
547           see <xref linkend="lustremaint.adding_new_ost" /></para>
548       <para condition='l26'>In some cases, there may be processes holding
549         files open that are consuming a significant amount of space (e.g.
550         runaway process writing lots of data to an open file that has been
551         deleted).  It is possible to get a list of all open file handles in the
552         filesystem from the MDS:
553         <screen>
554 mds# lctl get_param mdt.*.exports.*.open_files
555 mdt.myth-MDT0000.exports.192.168.20.159@tcp.open_files=
556 [0x200003ab4:0x435:0x0]
557 [0x20001e863:0x1c1:0x0]
558 [0x20001e863:0x1c2:0x0]
559 :
560 :
561         </screen>
562         These file handles can be converted into pathnames on any client via
563         the <literal>lfs fid2path</literal> command (as root):
564         <screen>
565 client# lfs fid2path /myth [0x200003ab4:0x435:0x0] [0x20001e863:0x1c1:0x0] [0x20001e863:0x1c2:0x0]
566 lfs fid2path: cannot find '[0x200003ab4:0x435:0x0]': No such file or directory
567 /myth/tmp/4M
568 /myth/tmp/1G
569 :
570 :
571         </screen>
572         In some cases, if the file has been deleted from the filesystem,
573         <literal>fid2path</literal> will return an error that the file is
574         not found.  You can use the client NID
575         (<literal>192.168.20.159@tcp</literal> in the above example) to
576         determine which node the file is open on, and <literal>lsof</literal>
577         to find and kill the process that is holding the file open:
578         <screen>
579 # lsof /myth
580 COMMAND   PID   USER  FD TYPE    DEVICE      SIZE/OFF               NODE NAME
581 logger  13806 mythtv  0r REG  35,632494 1901048576384 144115440203858997 /myth/logs/job.1283929.log (deleted)
582         </screen>
583       </para>
584       <para>A Linux error -28 (<literal>ENOSPC</literal>) that occurs when
585         a new file is being created may indicate that the MDT has run out
586         of inodes and needs to be made larger. Newly created files are not
587         written to full OSTs, while existing files continue to reside on
588         the OST where they were initially created. To view inode information
589         on the MDT, run on a client:</para>
590         <screen>
591 lfs df -i
592 UUID                      Inodes       IUsed       IFree IUse% Mounted on
593 myth-MDT0000_UUID        1910263     1910263           0 100% /myth[MDT:0]
594 myth-OST0000_UUID         947456      360059      587397  89% /myth[OST:0]
595 myth-OST0001_UUID         948864      233748      715116  91% /myth[OST:1]
596 myth-OST0002_UUID         947456      549961      397495  89% /myth[OST:2]
597 myth-OST0003_UUID        1426144      477595      948549  95% /myth[OST:3]
598 myth-OST0004_UUID        1426080      465248     1420832  57% /myth[OST:4]
599
600 filesystem_summary:      1910263     1910263           0 100% /myth
601         </screen>
602       <para>Typically, the Lustre software reports this error to your
603         application. If the application is checking the return code from
604         its function calls, then it decodes it into a textual error message
605         such as <literal>No space left on device</literal>. The numeric
606         error message may also appear in the system log.</para>
607       <para>For more information about the <literal>lfs df</literal> command,
608         see <xref linkend="dbdoclet.checking_free_space"/>.</para>
609       <para>You can also use the <literal>lctl get_param</literal> command to
610         monitor the space and object usage on the OSTs and MDTs from any
611         client:</para>
612         <screen>lctl get_param {osc,mdc}.*.{kbytes,files}{free,avail,total}
613         </screen>
614       <note>
615         <para>You can find other numeric error codes along with a short name
616         and text description in <literal>/usr/include/asm/errno.h</literal>.
617         </para>
618       </note>
619     </section>
620     <section remap="h3">
621       <title>Triggering Watchdog for PID NNN</title>
622       <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>
623       <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>
624       <screen>Lustre: 0:0:(watchdog.c:122:lcw_cb()) </screen>
625       <para>The above message indicates that the watchdog is active for pid 933:</para>
626       <para>It was inactive for 100000ms:</para>
627       <screen>Lustre: 0:0:(linux-debug.c:132:portals_debug_dumpstack()) </screen>
628       <para>Showing stack for process:</para>
629       <screen>933 ll_ost_25     D F896071A     0   933      1    934   932 (L-TLB)
630 f6d87c60 00000046 00000000 f896071a f8def7cc 00002710 00001822 2da48cae
631 0008cf1a f6d7c220 f6d7c3d0 f6d86000 f3529648 f6d87cc4 f3529640 f8961d3d
632 00000010 f6d87c9c ca65a13c 00001fff 00000001 00000001 00000000 00000001</screen>
633       <para>Call trace:</para>
634       <screen>filter_do_bio+0x3dd/0xb90 [obdfilter]
635 default_wake_function+0x0/0x20
636 filter_direct_io+0x2fb/0x990 [obdfilter]
637 filter_preprw_read+0x5c5/0xe00 [obdfilter]
638 lustre_swab_niobuf_remote+0x0/0x30 [ptlrpc]
639 ost_brw_read+0x18df/0x2400 [ost]
640 ost_handle+0x14c2/0x42d0 [ost]
641 ptlrpc_server_handle_request+0x870/0x10b0 [ptlrpc]
642 ptlrpc_main+0x42e/0x7c0 [ptlrpc]
643 </screen>
644     </section>
645     <section remap="h3">
646       <title><indexterm>
647           <primary>troubleshooting</primary>
648           <secondary>timeouts on setup</secondary>
649         </indexterm>Handling Timeouts on Initial Lustre File System Setup</title>
650       <para>If you come across timeouts or hangs on the initial setup of your Lustre file system,
651         verify that name resolution for servers and clients is working correctly. Some distributions
652         configure <literal>/etc/hosts</literal> so the name of the local machine (as reported by the
653         &apos;hostname&apos; command) is mapped to local host (127.0.0.1) instead of a proper IP
654         address.</para>
655       <para>This might produce this error:</para>
656       <screen>LustreError:(ldlm_handle_cancel()) received cancel for unknown lock cookie
657 0xe74021a4b41b954e from nid 0x7f000001 (0:127.0.0.1)
658 </screen>
659     </section>
660     <section remap="h3" xml:id="went_back_in_time">
661       <title>Handling/Debugging &quot;LustreError: xxx went back in time&quot;</title>
662       <para>Each time the MDS or OSS modifies the state of the MDT or OST disk
663       filesystem for a client, it records a per-target increasing transaction
664       number for the operation and returns it to the client along with the
665       reply to that operation. Periodically, when the server commits these
666       transactions to disk, the <literal>last_committed</literal> transaction
667       number is returned to the client to allow it to discard pending operations
668       from memory, as they will no longer be needed for recovery in case of
669       server failure.</para>
670       <para>In some cases error messages similar to the following have
671       been observed after a server was restarted or failed over:</para>
672       <screen>
673 LustreError: 3769:0:(import.c:517:ptlrpc_connect_interpret())
674 testfs-ost12_UUID went back in time (transno 831 was previously committed,
675 server now claims 791)!
676       </screen>
677       <para>This situation arises when:</para>
678       <itemizedlist>
679         <listitem>
680           <para>You are using a disk device that claims to have data written
681           to disk before it actually does, as in case of a device with a large
682           cache. If that disk device crashes or loses power in a way that
683           causes the loss of the cache, there can be a loss of transactions
684           that you believe are committed. This is a very serious event, and
685           you should run e2fsck against that storage before restarting the
686           Lustre file system.</para>
687         </listitem>
688         <listitem>
689           <para>As required by the Lustre software, the shared storage used
690           for failover is completely cache-coherent. This ensures that if one
691           server takes over for another, it sees the most up-to-date and
692           accurate copy of the data. In case of the failover of the server,
693           if the shared storage does not provide cache coherency between all
694           of its ports, then the Lustre software can produce an error.</para>
695         </listitem>
696       </itemizedlist>
697       <para>If you know the exact reason for the error, then it is safe to
698       proceed with no further action. If you do not know the reason, then this
699       is a serious issue and you should explore it with your disk vendor.</para>
700       <para>If the error occurs during failover, examine your disk cache
701       settings. If it occurs after a restart without failover, try to
702       determine how the disk can report that a write succeeded, then lose the
703       Data Device corruption or Disk Errors.</para>
704     </section>
705     <section remap="h3">
706       <title>Lustre Error: &quot;<literal>Slow Start_Page_Write</literal>&quot;</title>
707       <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>
708     </section>
709     <section remap="h3">
710       <title>Drawbacks in Doing Multi-client O_APPEND Writes</title>
711       <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>
712       <itemizedlist>
713         <listitem>
714           <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>
715         </listitem>
716         <listitem>
717           <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>
718         </listitem>
719         <listitem>
720           <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>
721         </listitem>
722       </itemizedlist>
723     </section>
724     <section remap="h3">
725       <title><indexterm>
726           <primary>troubleshooting</primary>
727           <secondary>slowdown during startup</secondary>
728         </indexterm>Slowdown Occurs During Lustre File System Startup</title>
729       <para>When a Lustre file system starts, it needs to read in data from the disk. For the very
730         first mdsrate run after the reboot, the MDS needs to wait on all the OSTs for object
731         pre-creation. This causes a slowdown to occur when the file system starts up.</para>
732       <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>
733     </section>
734     <section remap="h3">
735       <title><indexterm><primary>troubleshooting</primary><secondary>OST out of memory</secondary></indexterm>Log Message <literal>&apos;Out of Memory</literal>&apos; on OST</title>
736       <para>When planning the hardware for an OSS node, consider the memory usage of several
737         components in the Lustre file system. If insufficient memory is available, an &apos;out of
738         memory&apos; message can be logged.</para>
739       <para>During normal operation, several conditions indicate insufficient RAM on a server node:</para>
740       <itemizedlist>
741         <listitem>
742           <para> kernel &quot;<literal>Out of memory</literal>&quot; and/or &quot;<literal>oom-killer</literal>&quot; messages</para>
743         </listitem>
744         <listitem>
745           <para> Lustre &quot;<literal>kmalloc of &apos;mmm&apos; (NNNN bytes) failed...</literal>&quot; messages</para>
746         </listitem>
747         <listitem>
748           <para> Lustre or kernel stack traces showing processes stuck in &quot;<literal>try_to_free_pages</literal>&quot;</para>
749         </listitem>
750       </itemizedlist>
751       <para>For information on determining the MDS memory and OSS memory requirements, see <xref linkend="dbdoclet.50438256_26456"/>.</para>
752     </section>
753     <section remap="h3">
754       <title>Setting SCSI I/O Sizes</title>
755       <para>Some SCSI drivers default to a maximum I/O size that is too small for good Lustre file
756         system performance. we have fixed quite a few drivers, but you may still find that some
757         drivers give unsatisfactory performance with the Lustre file system. As the default value is
758         hard-coded, you need to recompile the drivers to change their default. On the other hand,
759         some drivers may have a wrong default set.</para>
760       <para>If you suspect bad I/O performance and an analysis of Lustre file system statistics
761         indicates that I/O is not 1 MB, check
762           <literal>/sys/block/<replaceable>device</replaceable>/queue/max_sectors_kb</literal>. If
763         the <literal>max_sectors_kb</literal> value is less than 1024, set it to at least 1024 to
764         improve performance. If changing <literal>max_sectors_kb</literal> does not change the I/O
765         size as reported by the Lustre software, you may want to examine the SCSI driver
766         code.</para>
767     </section>
768   </section>
769 </chapter>
770 <!--vim:expandtab:shiftwidth=2:tabstop=8:-->