Whamcloud - gitweb
LUDOC-173 trademarks: Completed first pass of Intel trademark compliance review.
[doc/manual.git] / LustreTroubleshooting.xml
1 <?xml version='1.0' encoding='UTF-8'?><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">
2   <title xml:id="lustretroubleshooting.title">Lustre Troubleshooting</title>
3   <para>This chapter provides information to troubleshoot Lustre, submit a Lustre bug, and Lustre performance tips. It includes the following sections:</para>
4   <itemizedlist>
5     <listitem>
6       <para><xref linkend="dbdoclet.50438198_11171"/></para>
7     </listitem>
8     <listitem>
9       <para><xref linkend="dbdoclet.50438198_30989"/></para>
10     </listitem>
11     <listitem>
12       <para><xref linkend="dbdoclet.50438198_93109"/></para>
13     </listitem>
14   </itemizedlist>
15   <section xml:id="dbdoclet.50438198_11171">
16       <title><indexterm><primary>troubleshooting</primary></indexterm>
17           <indexterm><primary>lustre</primary><secondary>troubleshooting</secondary><see>troubleshooting</see></indexterm>
18           <indexterm><primary>lustre</primary><secondary>errors</secondary><see>troubleshooting</see></indexterm>
19           <indexterm><primary>errors</primary><see>troubleshooting</see></indexterm>
20           Lustre Error Messages</title>
21     <para>Several resources are available to help troubleshoot Lustre. This section describes error numbers, error messages and logs.</para>
22     <section remap="h3">
23       <title><indexterm><primary>troubleshooting</primary><secondary>error numbers</secondary></indexterm>Error Numbers</title>
24       <para>Error numbers are generated by the Linux operating system and are located in
25           <literal>/usr/include/asm-generic/errno.h</literal>. The Lustre software does not use all
26         of the available Linux error numbers. The exact meaning of an error number depends on where
27         it is used. Here is a summary of the basic errors that Lustre users may encounter.</para>
28       <informaltable frame="all">
29         <tgroup cols="3">
30           <colspec colname="c1" colwidth="33*"/>
31           <colspec colname="c2" colwidth="33*"/>
32           <colspec colname="c3" colwidth="33*"/>
33           <thead>
34             <row>
35               <entry>
36                 <para><emphasis role="bold">Error Number</emphasis></para>
37               </entry>
38               <entry>
39                 <para><emphasis role="bold">Error Name</emphasis></para>
40               </entry>
41               <entry>
42                 <para><emphasis role="bold">Description</emphasis></para>
43               </entry>
44             </row>
45           </thead>
46           <tbody>
47             <row>
48               <entry>
49                 <para> -1</para>
50               </entry>
51               <entry>
52                 <literal> -EPERM </literal>
53               </entry>
54               <entry>
55                 <para> Permission is denied.</para>
56               </entry>
57             </row>
58             <row>
59               <entry> -2 </entry>
60               <entry>
61                 <literal> -ENOENT </literal>
62               </entry>
63               <entry>
64                 <para> The requested file or directory does not exist.</para>
65               </entry>
66             </row>
67             <row>
68               <entry>
69                 <para> -4</para>
70               </entry>
71               <entry>
72                 <literal> -EINTR </literal>
73               </entry>
74               <entry>
75                 <para> The operation was interrupted (usually CTRL-C or a killing process).</para>
76               </entry>
77             </row>
78             <row>
79               <entry>
80                 <para> -5</para>
81               </entry>
82               <entry>
83                 <literal> -EIO </literal>
84               </entry>
85               <entry>
86                 <para> The operation failed with a read or write error.</para>
87               </entry>
88             </row>
89             <row>
90               <entry>
91                 <para> -19</para>
92               </entry>
93               <entry>
94                 <literal> -ENODEV </literal>
95               </entry>
96               <entry>
97                 <para> No such device is available. The server stopped or failed over.</para>
98               </entry>
99             </row>
100             <row>
101               <entry>
102                 <para> -22</para>
103               </entry>
104               <entry>
105                 <literal> -EINVAL </literal>
106               </entry>
107               <entry>
108                 <para> The parameter contains an invalid value.</para>
109               </entry>
110             </row>
111             <row>
112               <entry>
113                 <para> -28</para>
114               </entry>
115               <entry>
116                 <literal> -ENOSPC </literal>
117               </entry>
118               <entry>
119                 <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>
120               </entry>
121             </row>
122             <row>
123               <entry>
124                 <para> -30</para>
125               </entry>
126               <entry>
127                 <literal> -EROFS </literal>
128               </entry>
129               <entry>
130                 <para> The file system is read-only, likely due to a detected error.</para>
131               </entry>
132             </row>
133             <row>
134               <entry>
135                 <para> -43</para>
136               </entry>
137               <entry>
138                 <literal> -EIDRM </literal>
139               </entry>
140               <entry>
141                 <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>
142               </entry>
143             </row>
144             <row>
145               <entry>
146                 <para> -107</para>
147               </entry>
148               <entry>
149                 <literal> -ENOTCONN </literal>
150               </entry>
151               <entry>
152                 <para> The client is not connected to this server.</para>
153               </entry>
154             </row>
155             <row>
156               <entry>
157                 <para> -110</para>
158               </entry>
159               <entry>
160                 <literal> -ETIMEDOUT </literal>
161               </entry>
162               <entry>
163                 <para> The operation took too long and timed out.</para>
164               </entry>
165             </row>
166             <row>
167               <entry>
168                 <para> -122</para>
169               </entry>
170               <entry>
171                 <literal> -EDQUOT </literal>
172               </entry>
173               <entry>
174                 <para> The operation exceeded the user disk quota and was aborted.</para>
175               </entry>
176             </row>
177           </tbody>
178         </tgroup>
179       </informaltable>
180     </section>
181     <section xml:id="dbdoclet.50438198_40669">
182       <title><indexterm><primary>troubleshooting</primary><secondary>error messages</secondary></indexterm>Viewing Error Messages</title>
183       <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>
184       <para>The error message initiates with &quot;LustreError&quot; in the console log and provides a short description of:</para>
185       <itemizedlist>
186         <listitem>
187           <para>What the problem is</para>
188         </listitem>
189         <listitem>
190           <para>Which process ID had trouble</para>
191         </listitem>
192         <listitem>
193           <para>Which server node it was communicating with, and so on.</para>
194         </listitem>
195       </itemizedlist>
196       <para>Lustre logs are dumped to <literal>/proc/sys/lnet/debug_path</literal>.</para>
197       <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>
198       <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>
199       <screen>$ lctl dk <replaceable>filename</replaceable></screen>
200       <note>
201         <para>LBUG freezes the thread to allow capture of the panic stack. A system reboot is needed to clear the thread.</para>
202       </note>
203     </section>
204   </section>
205   <section xml:id="dbdoclet.50438198_30989">
206       <title><indexterm><primary>troubleshooting</primary><secondary>reporting bugs</secondary></indexterm><indexterm><primary>reporting bugs</primary><see>troubleshooting</see></indexterm>
207           Reporting a Lustre Bug</title>
208     <para>If you cannot resolve a problem by troubleshooting your Lustre file system, other options are:<itemizedlist>
209         <listitem>
210           <para>Post a question to the <link xmlns:xlink="http://www.w3.org/1999/xlink"
211               xlink:href="https://lists.01.org/mailman/listinfo/hpdd-discuss">hppd-discuss</link>
212             email list or search the archives for information about your issue.</para>
213         </listitem>
214         <listitem>
215           <para>Submit a ticket to the <link xmlns:xlink="http://www.w3.org/1999/xlink"
216               xlink:href="https://jira.hpdd.intel.com/secure/Dashboard.jspa"
217                 >Jira</link><abbrev><superscript>*</superscript></abbrev> bug tracking and project
218             management tool used for the Lustre project. If you are a first-time user, you'll need
219             to open an account by clicking on <emphasis role="bold">Sign up</emphasis> on the
220             Welcome page.</para>
221         </listitem>
222       </itemizedlist> To submit a Jira ticket, follow these steps:<orderedlist>
223         <listitem>
224           <para>To avoid filing a duplicate ticket, search for existing tickets for your issue.
225               <emphasis role="italic">For search tips, see <xref
226                 xmlns:xlink="http://www.w3.org/1999/xlink" linkend="section_jj2_4b1_kk"
227               />.</emphasis></para>
228         </listitem>
229         <listitem>
230           <para>To create a ticket, click <emphasis role="bold">+Create Issue</emphasis> in the
231             upper right corner. <emphasis role="italic">Create a separate ticket for each issue you
232               wish to submit.</emphasis></para>
233         </listitem>
234         <listitem>
235           <para>In the form displayed, enter the following information:<itemizedlist>
236               <listitem>
237                 <para><emphasis role="italic">Project</emphasis> - Select <emphasis role="bold"
238                     >Lustre</emphasis> or <emphasis role="bold">Lustre Documentation</emphasis> or
239                   an appropriate project.</para>
240               </listitem>
241               <listitem>
242                 <para><emphasis role="italic">Issue type</emphasis> - Select <emphasis role="bold"
243                     >Bug</emphasis>.</para>
244               </listitem>
245               <listitem>
246                 <para><emphasis role="italic">Summary</emphasis> - Enter a short description of the
247                   issue. Use terms that would be useful for someone searching for a similar issue. A
248                   LustreError or ASSERT/panic message often makes a good summary.</para>
249               </listitem>
250               <listitem>
251                 <para><emphasis role="italic">Affects version(s)</emphasis> - Select your Lustre
252                   version.</para>
253               </listitem>
254               <listitem>
255                 <para><emphasis role="italic">Environment</emphasis> - Enter your kernel with
256                   version number.</para>
257               </listitem>
258               <listitem>
259                 <para><emphasis role="italic">Description</emphasis> - Include a detailed
260                   description of <emphasis role="italic">visible symptoms</emphasis> and, if
261                   possible, <emphasis role="italic">how the problem is produced</emphasis>. Other
262                   useful information may include <emphasis role="italic">the behavior you expect to
263                     see</emphasis> and <emphasis role="italic">what you have tried so far to
264                     diagnose the problem</emphasis>.</para>
265               </listitem>
266               <listitem>
267                 <para><emphasis role="italic">Attachments</emphasis> - Attach log sources such as
268                   Lustre debug log dumps (see <xref xmlns:xlink="http://www.w3.org/1999/xlink"
269                     linkend="dbdoclet.50438274_15874"/>), syslogs, or console logs. <emphasis
270                     role="italic"><emphasis role="bold">Note:</emphasis></emphasis> Lustre debug
271                   logs must be processed using <code>lctl df</code> prior to attaching to a Jira
272                   ticket. For more information, see <xref xmlns:xlink="http://www.w3.org/1999/xlink"
273                     linkend="dbdoclet.50438274_62472"/>. </para>
274               </listitem>
275             </itemizedlist>Other fields in the form are used for project tracking and are irrelevant
276             to reporting an issue. You can leave these in their default state.</para>
277         </listitem>
278       </orderedlist></para>
279     <section xml:id="section_jj2_4b1_kk">
280       <title>Searching the Jira<superscript>*</superscript> Bug Tracker for Duplicate
281         Tickets</title>
282       <para>Before submitting a ticket, always search the Jira bug tracker for an existing ticket
283         for your issue.This avoids duplicating effort and may immediately provide you with a
284         solution to your problem. </para>
285       <para>To do a search in the Jira bug tracker, select the <emphasis role="bold"
286           >Issues</emphasis> tab and click on <emphasis role="bold">New filter</emphasis>. Use the
287         filters provided to select criteria for your search. To search for specific text, enter the
288         text in the "Contains text" field and click the magnifying glass icon.</para>
289       <para>When searching for text such as an ASSERTION or LustreError message, you can remove NIDS
290         and other installation-specific text from your search string by following the example
291         below.</para>
292       <para><emphasis role="italic">Original error message:</emphasis></para>
293       <para><code>"(filter_io_26.c:</code><emphasis role="bold"
294           >791</emphasis><code>:filter_commitrw_write()) ASSERTION(oti-&gt;oti_transno
295           &lt;=obd-&gt;obd_last_committed) failed: oti_transno </code><emphasis role="bold"
296           >752</emphasis>
297         <code>last_committed </code><emphasis role="bold">750</emphasis><code>"</code></para>
298       <para><emphasis role="italic">Optimized search string :</emphasis></para>
299       <para><code>"(filter_io_26.c:" </code><emphasis role="bold">AND</emphasis>
300         <code>":filter_commitrw_write()) ASSERTION(oti-&gt;oti_transno
301           &lt;=obd-&gt;obd_last_committed) failed:</code></para>
302     </section>
303   </section>
304   <section xml:id="dbdoclet.50438198_93109">
305     <title><indexterm><primary>troubleshooting</primary><secondary>common problems</secondary></indexterm>Common Lustre Problems</title>
306     <para>This section describes how to address common issues encountered with Lustre.</para>
307     <section remap="h3">
308       <title>OST Object is Missing or Damaged</title>
309       <para>If the OSS fails to find an object or finds a damaged object, this message appears:</para>
310       <para><screen>OST object missing or damaged (OST &quot;ost1&quot;, object 98148, error -2)</screen></para>
311       <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>
312       <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>
313       <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>
314       <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>
315       <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>
316       <para><emphasis role="bold">Suggested Action</emphasis></para>
317       <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>
318       <para>If the reported error is anything else, then you should immediately inspect this server for storage problems.</para>
319     </section>
320     <section remap="h3">
321       <title>OSTs Become Read-Only</title>
322       <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>
323       <para>To determine what caused the &quot;not healthy&quot; condition:</para>
324       <itemizedlist>
325         <listitem>
326           <para>Examine the consoles of all servers for any error indications</para>
327         </listitem>
328         <listitem>
329           <para>Examine the syslogs of all servers for any LustreErrors or <literal>LBUG</literal></para>
330         </listitem>
331         <listitem>
332           <para>Check the health of your system hardware and network. (Are the disks working as expected, is the network dropping packets?)</para>
333         </listitem>
334         <listitem>
335           <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>
336         </listitem>
337       </itemizedlist>
338       <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>
339     </section>
340     <section remap="h3">
341       <title>Identifying a Missing OST</title>
342       <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>
343       <orderedlist>
344         <listitem>
345           <para>Generate a list of devices and determine the OST&apos;s device number. Run:</para>
346           <screen>$ lctl dl </screen>
347           <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>
348         </listitem>
349         <listitem>
350           <para>Deactivate the OST (on the OSS at the MDS). Run:</para>
351           <screen>$ lctl --device <replaceable>lustre_device_number</replaceable> deactivate</screen>
352           <para>The OST device number or device name is generated by the lctl dl command.</para>
353           <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>
354           <note>
355             <para>If the OST later becomes available it needs to be reactivated, run:</para>
356             <screen># lctl --device <replaceable>lustre_device_number</replaceable> activate</screen>
357           </note>
358         </listitem>
359         <listitem>
360           <para>Determine all files that are striped over the missing OST, run:</para>
361           <screen># lfs getstripe -r -O {OST_UUID} /mountpoint</screen>
362           <para>This returns a simple list of filenames from the affected file system.</para>
363         </listitem>
364         <listitem>
365           <para>If necessary, you can read the valid parts of a striped file, run:</para>
366           <screen># dd if=filename of=new_filename bs=4k conv=sync,noerror</screen>
367         </listitem>
368         <listitem>
369           <para>You can delete these files with the unlink or munlink command.</para>
370           <screen># unlink|munlink filename {filename ...} </screen>
371           <note>
372             <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>
373             <para>When you run the <literal>unlink</literal> or <literal>munlink</literal> command, the file on the MDS is permanently removed.</para>
374           </note>
375         </listitem>
376         <listitem>
377           <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>
378           <screen># lfs getstripe -v {filename}</screen>
379         </listitem>
380         <listitem>
381           <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>
382           <para>where:</para>
383           <para>C = stripe count</para>
384           <para>S = stripe size</para>
385           <para>X = index of bad OST for this file</para>
386         </listitem>
387       </orderedlist>
388       <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>
389       <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>
390     </section>
391     <section xml:id="dbdoclet.50438198_69657">
392       <title>Fixing a Bad LAST_ID on an OST</title>
393       <para>Each OST contains a LAST_ID file, which holds the last object (pre-)created by the MDS  <footnote>
394           <para>The contents of the LAST_ID file must be accurate regarding the actual objects that exist on the OST.</para>
395         </footnote>. The MDT contains a lov_objid file, with values that represent the last object the MDS has allocated to a file.</para>
396       <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>
397       <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>
398       <para>Here is the rule to avoid this scenario:</para>
399       <para>LAST_ID &gt;= lov_objid and LAST_ID == last_physical_object and lov_objid &gt;= last_used_object</para>
400       <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>
401       <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>
402       <screen>&quot;filter_precreate()) HOME-OST0003: Serious error: 
403 objid 3478673 already exists; is this filesystem corrupt?&quot;</screen>
404       <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>
405       <screen>&quot;HOME-OST0003: ignoring bogus orphan destroy request: 
406 obdid 3438673 last_id 3478673&quot;</screen>
407       <para>To recover from this situation, determine and set a reasonable LAST_ID value.</para>
408       <note>
409         <para>The file system must be stopped on all servers before performing this procedure.</para>
410       </note>
411       <para>For hex-to-decimal translations:</para>
412       <para>Use GDB:</para>
413       <screen>(gdb) p /x 15028
414 $2 = 0x3ab4</screen>
415       <para>Or <literal>bc</literal>:</para>
416       <screen>echo &quot;obase=16; 15028&quot; | bc</screen>
417       <orderedlist>
418         <listitem>
419           <para>Determine a reasonable value for the LAST_ID file. Check on the MDS:</para>
420           <screen># mount -t ldiskfs <replaceable>/dev/mdt_device</replaceable> /mnt/mds
421 # od -Ax -td8 /mnt/mds/lov_objid
422 </screen>
423           <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>
424         </listitem>
425         <listitem>
426           <para>Determine the OST index for this OST.</para>
427           <screen># od -Ax -td4 /mnt/ost/last_rcvd
428 </screen>
429           <para>It will have it at offset 0x8c.</para>
430         </listitem>
431         <listitem>
432           <para>Check on the OST. Use debugfs to check the LAST_ID value:</para>
433           <screen>debugfs -c -R &apos;dump /O/0/LAST_ID /tmp/LAST_ID&apos; /dev/XXX ; od -Ax -td8 /tmp/\
434 LAST_ID&quot;
435 </screen>
436         </listitem>
437         <listitem>
438           <para>Check the objects on the OST:</para>
439           <screen>mount -rt ldiskfs /dev/{ostdev} /mnt/ost
440 # note the ls below is a number one and not a letter L
441 ls -1s /mnt/ost/O/0/d* | grep -v [a-z] |
442 sort -k2 -n &gt; /tmp/objects.{diskname}
443  
444 tail -30 /tmp/objects.{diskname}</screen>
445           <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>
446         </listitem>
447       </orderedlist>
448       <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>
449       <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>
450       <para>Once you have decided on a proper value for LAST_ID, use this repair procedure.</para>
451       <orderedlist>
452         <listitem>
453           <para>Access:</para>
454           <screen>mount -t ldiskfs /dev/{ostdev} /mnt/ost</screen>
455         </listitem>
456         <listitem>
457           <para>Check the current:</para>
458           <screen>od -Ax -td8 /mnt/ost/O/0/LAST_ID</screen>
459         </listitem>
460         <listitem>
461           <para>Be very safe, only work on backups:</para>
462           <screen>cp /mnt/ost/O/0/LAST_ID /tmp/LAST_ID</screen>
463         </listitem>
464         <listitem>
465           <para>Convert binary to text:</para>
466           <screen>xxd /tmp/LAST_ID /tmp/LAST_ID.asc</screen>
467         </listitem>
468         <listitem>
469           <para>Fix:</para>
470           <screen>vi /tmp/LAST_ID.asc</screen>
471         </listitem>
472         <listitem>
473           <para>Convert to binary:</para>
474           <screen>xxd -r /tmp/LAST_ID.asc /tmp/LAST_ID.new</screen>
475         </listitem>
476         <listitem>
477           <para>Verify:</para>
478           <screen>od -Ax -td8 /tmp/LAST_ID.new</screen>
479         </listitem>
480         <listitem>
481           <para>Replace:</para>
482           <screen>cp /tmp/LAST_ID.new /mnt/ost/O/0/LAST_ID</screen>
483         </listitem>
484         <listitem>
485           <para>Clean up:</para>
486           <screen>umount /mnt/ost</screen>
487         </listitem>
488       </orderedlist>
489     </section>
490     <section remap="h3">
491       <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>
492       <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>
493       <para>Unfortunately, you cannot set sunprc to avoid port 988. If you receive this error, do the following:</para>
494       <itemizedlist>
495         <listitem>
496           <para>Start Lustre before starting any service that uses sunrpc.</para>
497         </listitem>
498         <listitem>
499           <para>Use a port other than 988 for Lustre. This is configured in <literal>/etc/modprobe.d/lustre.conf</literal> as an option to the LNET module. For example:</para>
500           <screen>options lnet accept_port=988</screen>
501         </listitem>
502       </itemizedlist>
503       <itemizedlist>
504         <listitem>
505           <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>
506         </listitem>
507       </itemizedlist>
508       <note>
509         <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>
510       </note>
511     </section>
512     <section remap="h3">
513       <title><indexterm><primary>troubleshooting</primary><secondary>'Error -28'</secondary></indexterm>Handling/Debugging Error &quot;- 28&quot;</title>
514       <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>
515       <screen>lfs df -h</screen>
516       <para>To address this issue, you can do one of the following:</para>
517       <itemizedlist>
518         <listitem>
519           <para>Expand the disk space on the OST.</para>
520         </listitem>
521         <listitem>
522           <para>Copy or stripe the file to a less full OST.</para>
523         </listitem>
524       </itemizedlist>
525       <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>
526       <screen>lfs df -i</screen>
527       <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>
528       <para>For more information about the <literal>lfs df</literal> command, see <xref linkend="dbdoclet.50438209_35838"/>.</para>
529       <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>
530       <screen>grep &apos;[0-9]&apos; /proc/fs/lustre/osc/*/kbytes{free,avail,total}
531 grep &apos;[0-9]&apos; /proc/fs/lustre/osc/*/files{free,total}
532 grep &apos;[0-9]&apos; /proc/fs/lustre/mdc/*/kbytes{free,avail,total}
533 grep &apos;[0-9]&apos; /proc/fs/lustre/mdc/*/files{free,total}</screen>
534       <note>
535         <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>
536       </note>
537     </section>
538     <section remap="h3">
539       <title>Triggering Watchdog for PID NNN</title>
540       <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>
541       <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>
542       <screen>Lustre: 0:0:(watchdog.c:122:lcw_cb()) </screen>
543       <para>The above message indicates that the watchdog is active for pid 933:</para>
544       <para>It was inactive for 100000ms:</para>
545       <screen>Lustre: 0:0:(linux-debug.c:132:portals_debug_dumpstack()) </screen>
546       <para>Showing stack for process:</para>
547       <screen>933 ll_ost_25     D F896071A     0   933      1    934   932 (L-TLB)
548 f6d87c60 00000046 00000000 f896071a f8def7cc 00002710 00001822 2da48cae
549 0008cf1a f6d7c220 f6d7c3d0 f6d86000 f3529648 f6d87cc4 f3529640 f8961d3d
550 00000010 f6d87c9c ca65a13c 00001fff 00000001 00000001 00000000 00000001</screen>
551       <para>Call trace:</para>
552       <screen>filter_do_bio+0x3dd/0xb90 [obdfilter]
553 default_wake_function+0x0/0x20
554 filter_direct_io+0x2fb/0x990 [obdfilter]
555 filter_preprw_read+0x5c5/0xe00 [obdfilter]
556 lustre_swab_niobuf_remote+0x0/0x30 [ptlrpc]
557 ost_brw_read+0x18df/0x2400 [ost]
558 ost_handle+0x14c2/0x42d0 [ost]
559 ptlrpc_server_handle_request+0x870/0x10b0 [ptlrpc]
560 ptlrpc_main+0x42e/0x7c0 [ptlrpc]
561 </screen>
562     </section>
563     <section remap="h3">
564       <title><indexterm><primary>troubleshooting</primary><secondary>timeouts on setup</secondary></indexterm>Handling Timeouts on Initial Lustre Setup</title>
565       <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</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>
566       <para>This might produce this error:</para>
567       <screen>LustreError:(ldlm_handle_cancel()) received cancel for unknown lock cookie
568 0xe74021a4b41b954e from nid 0x7f000001 (0:127.0.0.1)
569 </screen>
570     </section>
571     <section remap="h3">
572       <title>Handling/Debugging &quot;LustreError: xxx went back in time&quot;</title>
573       <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>
574       <para>This situation arises when:</para>
575       <itemizedlist>
576         <listitem>
577           <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>
578         </listitem>
579         <listitem>
580           <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>
581         </listitem>
582       </itemizedlist>
583       <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>
584       <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>
585     </section>
586     <section remap="h3">
587       <title>Lustre Error: &quot;<literal>Slow Start_Page_Write</literal>&quot;</title>
588       <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>
589     </section>
590     <section remap="h3">
591       <title>Drawbacks in Doing Multi-client O_APPEND Writes</title>
592       <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>
593       <itemizedlist>
594         <listitem>
595           <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>
596         </listitem>
597         <listitem>
598           <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>
599         </listitem>
600         <listitem>
601           <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>
602         </listitem>
603       </itemizedlist>
604     </section>
605     <section remap="h3">
606       <title><indexterm><primary>troubleshooting</primary><secondary>slowdown during startup</secondary></indexterm>Slowdown Occurs During Lustre Startup</title>
607       <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>
608       <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>
609     </section>
610     <section remap="h3">
611       <title><indexterm><primary>troubleshooting</primary><secondary>OST out of memory</secondary></indexterm>Log Message <literal>&apos;Out of Memory</literal>&apos; on OST</title>
612       <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>
613       <para>During normal operation, several conditions indicate insufficient RAM on a server node:</para>
614       <itemizedlist>
615         <listitem>
616           <para> kernel &quot;<literal>Out of memory</literal>&quot; and/or &quot;<literal>oom-killer</literal>&quot; messages</para>
617         </listitem>
618         <listitem>
619           <para> Lustre &quot;<literal>kmalloc of &apos;mmm&apos; (NNNN bytes) failed...</literal>&quot; messages</para>
620         </listitem>
621         <listitem>
622           <para> Lustre or kernel stack traces showing processes stuck in &quot;<literal>try_to_free_pages</literal>&quot;</para>
623         </listitem>
624       </itemizedlist>
625       <para>For information on determining the MDS memory and OSS memory requirements, see <xref linkend="dbdoclet.50438256_26456"/>.</para>
626     </section>
627     <section remap="h3">
628       <title>Setting SCSI I/O Sizes</title>
629       <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>
630       <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/<replaceable>device</replaceable>/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>
631     </section>
632   </section>
633 </chapter>