Whamcloud - gitweb
FIX: proofed against origional
[doc/manual.git] / LustreRecovery.xml
1 <?xml version='1.0' encoding='UTF-8'?>
2 <!-- This document was created with Syntext Serna Free. -->
3 <chapter xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" version="5.0" xml:lang="en-US" xml:id="lustrerecovery">
4   <info>
5     <title xml:id="lustrerecovery.title">Lustre Recovery</title>
6   </info>
7   <para>This chapter describes how recovery is implemented in Lustre and includes the following sections:</para>
8   <itemizedlist>
9     <listitem>
10       <para><xref linkend="dbdoclet.50438268_58047"/></para>
11     </listitem>
12     <listitem>
13       <para><xref linkend="dbdoclet.50438268_65824"/></para>
14     </listitem>
15     <listitem>
16       <para><xref linkend="dbdoclet.50438268_23736"/></para>
17     </listitem>
18     <listitem>
19       <para><xref linkend="dbdoclet.50438268_80068"/></para>
20     </listitem>
21     <listitem>
22       <para><xref linkend="dbdoclet.50438268_83826"/></para>
23     </listitem>
24   </itemizedlist>
25   <section xml:id="dbdoclet.50438268_58047">
26     <title>30.1 Recovery Overview</title>
27     <para>Lustre&apos;s recovery feature is responsible for dealing with node or network failure and returning the cluster to a consistent, performant state. Because Lustre allows servers to perform asynchronous update operations to the on-disk file system (i.e., the server can reply without waiting for the update to synchronously commit to disk), the clients may have state in memory that is newer than what the server can recover from disk after a crash.</para>
28     <para>A handful of different types of failures can cause recovery to occur:</para>
29     <itemizedlist>
30       <listitem>
31         <para> Client (compute node) failure</para>
32       </listitem>
33       <listitem>
34         <para> MDS failure (and failover)</para>
35       </listitem>
36       <listitem>
37         <para> OST failure (and failover)</para>
38       </listitem>
39       <listitem>
40         <para> Transient network partition</para>
41       </listitem>
42     </itemizedlist>
43     <para>Currently, all Lustre failure and recovery operations are based on the concept of connection failure; all imports or exports associated with a given connection are considered to fail if any of them fail.</para>
44     <para>For information on Lustre recovery, see <xref linkend="dbdoclet.50438268_65824"/>. For information on recovering from a corrupt file system, see <xref linkend="dbdoclet.50438268_83826"/>. For information on resolving orphaned objects, a common issue after recovery, see <xref linkend="dbdoclet.50438225_13916"/>.</para>
45     <section remap="h3">
46       <title>30.1.1 Client Failure</title>
47       <para>Recovery from client failure in Lustre is based on lock revocation and other resources, so surviving clients can continue their work uninterrupted. If a client fails to timely respond to a blocking lock callback from the Distributed Lock Manager (DLM) or fails to communicate with the server in a long period of time (i.e., no pings), the client is forcibly removed from the cluster (evicted). This enables other clients to acquire locks blocked by the dead client&apos;s locks, and also frees resources (file handles, export data) associated with that client. Note that this scenario can be caused by a network partition, as well as an actual client node system failure. <xref linkend="dbdoclet.50438268_96876"/> describes this case in more detail.</para>
48     </section>
49     <section xml:id="dbdoclet.50438268_43796">
50       <title>30.1.2 Client Eviction</title>
51       <para>If a client is not behaving properly from the server&apos;s point of view, it will be evicted. This ensures that the whole file system can continue to function in the presence of failed or misbehaving clients. An evicted client must invalidate all locks, which in turn, results in all cached inodes becoming invalidated and all cached data being flushed.</para>
52       <para>Reasons why a client might be evicted:</para>
53       <itemizedlist>
54         <listitem>
55           <para> Failure to respond to a server request in a timely manner</para>
56           <itemizedlist>
57             <listitem>
58               <para> Blocking lock callback (i.e., client holds lock that another client/server wants)</para>
59             </listitem>
60             <listitem>
61               <para> Lock completion callback (i.e., client is granted lock previously held by another client)</para>
62             </listitem>
63             <listitem>
64               <para> Lock glimpse callback (i.e., client is asked for size of object by another client)</para>
65             </listitem>
66             <listitem>
67               <para> Server shutdown notification (with simplified interoperability)</para>
68             </listitem>
69           </itemizedlist>
70         </listitem>
71         <listitem>
72           <para> Failure to ping the server in a timely manner, unless the server is receiving no RPC traffic at all (which may indicate a network partition).</para>
73         </listitem>
74       </itemizedlist>
75     </section>
76     <section remap="h3">
77       <title>30.1.3 MDS Failure (Failover)</title>
78       <para>Highly-available (HA) Lustre operation requires that the metadata server have a peer configured for failover, including the use of a shared storage device for the MDT backing file system. The actual mechanism for detecting peer failure, power off (STONITH) of the failed peer (to prevent it from continuing to modify the shared disk), and takeover of the Lustre MDS service on the backup node depends on external HA software such as Heartbeat. It is also possible to have MDS recovery with a single MDS node. In this case, recovery will take as long as is needed for the single MDS to be restarted.</para>
79       <para>When clients detect an MDS failure (either by timeouts of in-flight requests or idle-time ping messages), they connect to the new backup MDS and use the Metadata Replay protocol. Metadata Replay is responsible for ensuring that the backup MDS re-acquires state resulting from transactions whose effects were made visible to clients, but which were not committed to the disk.</para>
80       <para>The reconnection to a new (or restarted) MDS is managed by the file system configuration loaded by the client when the file system is first mounted. If a failover MDS has been configured (using the <literal>--failnode=</literal> option to <literal>mkfs.lustre</literal> or <literal>tunefs.lustre</literal>), the client tries to reconnect to both the primary and backup MDS until one of them responds that the failed MDT is again available. At that point, the client begins recovery. For more information, see <xref linkend="dbdoclet.50438268_65824"/>.</para>
81       <para>Transaction numbers are used to ensure that operations are replayed in the order they were originally performed, so that they are guaranteed to succeed and present the same filesystem state as before the failure. In addition, clients inform the new server of their existing lock state (including locks that have not yet been granted). All metadata and lock replay must complete before new, non-recovery operations are permitted. In addition, only clients that were connected at the time of MDS failure are permitted to reconnect during the recovery window, to avoid the introduction of state changes that might conflict with what is being replayed by previously-connected clients.</para>
82     </section>
83     <section remap="h3">
84       <title>30.1.4 OST Failure (Failover)</title>
85       <para>When an OST fails or has communication problems with the client, the default action is that the corresponding OSC enters recovery, and I/O requests going to that OST are blocked waiting for OST recovery or failover. It is possible to administratively mark the OSC as <emphasis>inactive</emphasis> on the client, in which case file operations that involve the failed OST will return an IO error (<literal>-EIO</literal>). Otherwise, the application waits until the OST has recovered or the client process is interrupted (e.g. ,with <emphasis>CTRL-C</emphasis>).</para>
86       <para>The MDS (via the LOV) detects that an OST is unavailable and skips it when assigning objects to new files. When the OST is restarted or re-establishes communication with the MDS, the MDS and OST automatically perform orphan recovery to destroy any objects that belong to files that were deleted while the OST was unavailable. For more information, see <xref linkend="troubleshootingrecovery"/> (Working with Orphaned Objects).</para>
87       <para>While the OSC to OST operation recovery protocol is the same as that between the MDC and MDT using the Metadata Replay protocol, typically the OST commits bulk write operations to disk synchronously and each reply indicates that the request is already committed and the data does not need to be saved for recovery. In some cases, the OST replies to the client before the operation is committed to disk (e.g. truncate, destroy, setattr, and I/O operations in very new versions of Lustre), and normal replay and resend handling is done, including resending of the bulk writes. In this case, the client keeps a copy of the data available in memory until the server indicates that the write has committed to disk.</para>
88       <para>To force an OST recovery, unmount the OST and then mount it again. If the OST was connected to clients before it failed, then a recovery process starts after the remount, enabling clients to reconnect to the OST and replay transactions in their queue. When the OST is in recovery mode, all new client connections are refused until the recovery finishes. The recovery is complete when either all previously-connected clients reconnect and their transactions are replayed or a client connection attempt times out. If a connection attempt times out, then all clients waiting to reconnect (and their transactions) are lost.</para>
89       <note>
90         <para>If you know an OST will not recover a previously-connected client (if, for example, the client has crashed), you can manually abort the recovery using this command:</para>
91         <para><screen>lctl --device &lt;OST device number&gt; abort_recovery</screen></para>
92         <para>To determine an OST&apos;s device number and device name, run the <literal>lctl dl</literal> command. Sample <literal>lctl dl</literal> command output is shown below:</para>
93         <screen>7 UP obdfilter ddn_data-OST0009 ddn_data-OST0009_UUID 1159 </screen>
94         <para>In this example, 7 is the OST device number. The device name is <literal>ddn_data-OST0009</literal>. In most instances, the device name can be used in place of the device number.</para>
95       </note>
96     </section>
97     <section xml:id="dbdoclet.50438268_96876">
98       <title>30.1.5 Network Partition</title>
99       <para>Network failures may be transient. To avoid invoking recovery, the client tries, initially, to re-send any timed out request to the server. If the resend also fails, the client tries to re-establish a connection to the server. Clients can detect harmless partition upon reconnect if the server has not had any reason to evict the client.</para>
100       <para>If a request was processed by the server, but the reply was dropped (i.e., did not arrive back at the client), the server must reconstruct the reply when the client resends the request, rather than performing the same request twice.</para>
101     </section>
102     <section remap="h3">
103       <title>30.1.6 Failed Recovery</title>
104       <para>In the case of failed recovery, a client is evicted by the server and must reconnect after having flushed its saved state related to that server, as described in <xref linkend="dbdoclet.50438268_43796">Client Eviction</xref>, above. Failed recovery might occur for a number of reasons, including:</para>
105       <itemizedlist>
106         <listitem>
107           <para> Failure of recovery</para>
108           <itemizedlist>
109             <listitem>
110               <para> Recovery fails if the operations of one client directly depend on the operations of another client that failed to participate in recovery. Otherwise, Version Based Recovery (VBR) allows recovery to proceed for all of the connected clients, and only missing clients are evicted.</para>
111             </listitem>
112             <listitem>
113               <para> Manual abort of recovery</para>
114             </listitem>
115           </itemizedlist>
116         </listitem>
117         <listitem>
118           <para> Manual eviction by the administrator</para>
119         </listitem>
120       </itemizedlist>
121     </section>
122   </section>
123   <section xml:id="dbdoclet.50438268_65824">
124     <title>30.2 Metadata Replay</title>
125     <para>Highly available Lustre operation requires that the MDS have a peer configured for failover, including the use of a shared storage device for the MDS backing file system. When a client detects an MDS failure, it connects to the new MDS and uses the metadata replay protocol to replay its requests.</para>
126     <para>Metadata replay ensures that the failover MDS re-accumulates state resulting from transactions whose effects were made visible to clients, but which were not committed to the disk.</para>
127     <section remap="h3">
128       <title>30.2.1 XID Numbers</title>
129       <para>Each request sent by the client contains an XID number, which is a client-unique, monotonically increasing 64-bit integer. The initial value of the XID is chosen so that it is highly unlikely that the same client node reconnecting to the same server after a reboot would have the same XID sequence. The XID is used by the client to order all of the requests that it sends, until such a time that the request is assigned a transaction number. The XID is also used in Reply Reconstruction to uniquely identify per-client requests at the server.</para>
130     </section>
131     <section remap="h3">
132       <title>30.2.2 Transaction Numbers</title>
133       <para>Each client request processed by the server that involves any state change (metadata update, file open, write, etc., depending on server type) is assigned a transaction number by the server that is a target-unique, monontonically increasing, server-wide 64-bit integer. The transaction number for each file system-modifying request is sent back to the client along with the reply to that client request. The transaction numbers allow the client and server to unambiguously order every modification to the file system in case recovery is needed.</para>
134       <para>Each reply sent to a client (regardless of request type) also contains the last committed transaction number that indicates the highest transaction number committed to the file system. The <literal>ldiskfs</literal> backing file system that Lustre uses enforces the requirement that any earlier disk operation will always be committed to disk before a later disk operation, so the last committed transaction number also reports that any requests with a lower transaction number have been committed to disk.</para>
135     </section>
136     <section remap="h3">
137       <title>30.2.3 Replay and Resend</title>
138       <para>Lustre recovery can be separated into two distinct types of operations: <emphasis>replay</emphasis> and <emphasis>resend</emphasis>.</para>
139       <para><emphasis>Replay</emphasis> operations are those for which the client received a reply from the server that the operation had been successfully completed. These operations need to be redone in exactly the same manner after a server restart as had been reported before the server failed. Replay can only happen if the server failed; otherwise it will not have lost any state in memory.</para>
140       <para><emphasis>Resend</emphasis> operations are those for which the client never received a reply, so their final state is unknown to the client. The client sends unanswered requests to the server again in XID order, and again awaits a reply for each one. In some cases, resent requests have been handled and committed to disk by the server (possibly also having dependent operations committed), in which case, the server performs reply reconstruction for the lost reply. In other cases, the server did not receive the lost request at all and processing proceeds as with any normal request. These are what happen in the case of a network interruption. It is also possible that the server received the request, but was unable to reply or commit it to disk before failure.</para>
141     </section>
142     <section remap="h3">
143       <title>30.2.4 Client Replay List</title>
144       <para>All file system-modifying requests have the potential to be required for server state recovery (replay) in case of a server failure. Replies that have an assigned transaction number that is higher than the last committed transaction number received in any reply from each server are preserved for later replay in a per-server replay list. As each reply is received from the server, it is checked to see if it has a higher last committed transaction number than the previous highest last committed number. Most requests that now have a lower transaction number can safely be removed from the replay list. One exception to this rule is for open requests, which need to be saved for replay until the file is closed so that the MDS can properly reference count open-unlinked files.</para>
145     </section>
146     <section remap="h3">
147       <title>30.2.5 Server Recovery</title>
148       <para>A server enters recovery if it was not shut down cleanly. If, upon startup, if any client entries are in the <literal>last_rcvd</literal> file for any previously connected clients, the server enters recovery mode and waits for these previously-connected clients to reconnect and begin replaying or resending their requests. This allows the server to recreate state that was exposed to clients (a request that completed successfully) but was not committed to disk before failure.</para>
149       <para>In the absence of any client connection attempts, the server waits indefinitely for the clients to reconnect. This is intended to handle the case where the server has a network problem and clients are unable to reconnect and/or if the server needs to be restarted repeatedly to resolve some problem with hardware or software. Once the server detects client connection attempts - either new clients or previously-connected clients - a recovery timer starts and forces recovery to finish in a finite time regardless of whether the previously-connected clients are available or not.</para>
150       <para>If no client entries are present in the <literal>last_rcvd</literal> file, or if the administrator manually aborts recovery, the server does not wait for client reconnection and proceeds to allow all clients to connect.</para>
151       <para>As clients connect, the server gathers information from each one to determine how long the recovery needs to take. Each client reports its connection UUID, and the server does a lookup for this UUID in the <literal>last_rcvd</literal> file to determine if this client was previously connected. If not, the client is refused connection and it will retry until recovery is completed. Each client reports its last seen transaction, so the server knows when all transactions have been replayed. The client also reports the amount of time that it was previously waiting for request completion so that the server can estimate how long some clients might need to detect the server failure and reconnect.</para>
152       <para>If the client times out during replay, it attempts to reconnect. If the client is unable to reconnect, <literal>REPLAY</literal> fails and it returns to <literal>DISCON</literal> state. It is possible that clients will timeout frequently during <literal>REPLAY</literal>, so reconnection should not delay an already slow process more than necessary. We can mitigate this by increasing the timeout during replay.</para>
153     </section>
154     <section remap="h3">
155       <title>30.2.6 Request Replay</title>
156       <para>If a client was previously connected, it gets a response from the server telling it that the server is in recovery and what the last committed transaction number on disk is. The client can then iterate through its replay list and use this last committed transaction number to prune any previously-committed requests. It replays any newer requests to the server in transaction number order, one at a time, waiting for a reply from the server before replaying the next request.</para>
157       <para>Open requests that are on the replay list may have a transaction number lower than the server&apos;s last committed transaction number. The server processes those open requests immediately. The server then processes replayed requests from all of the clients in transaction number order, starting at the last committed transaction number to ensure that the state is updated on disk in exactly the same manner as it was before the crash. As each replayed request is processed, the last committed transaction is incremented. If the server receives a replay request from a client that is higher than the current last committed transaction, that request is put aside until other clients provide the intervening transactions. In this manner, the server replays requests in the same sequence as they were previously executed on the server until either all clients are out of requests to replay or there is a gap in a sequence.</para>
158     </section>
159     <section remap="h3">
160       <title>30.2.7 Gaps in the Replay Sequence</title>
161       <para>In some cases, a gap may occur in the reply sequence. This might be caused by lost replies, where the request was processed and committed to disk but the reply was not received by the client. It can also be caused by clients missing from recovery due to partial network failure or client death.</para>
162       <para>In the case where all clients have reconnected, but there is a gap in the replay sequence the only possibility is that some requests were processed by the server but the reply was lost. Since the client must still have these requests in its resend list, they are processed after recovery is finished.</para>
163       <para>In the case where all clients have not reconnected, it is likely that the failed clients had requests that will no longer be replayed. The VBR feature is used to determine if a request following a transaction gap is safe to be replayed. Each item in the file system (MDS inode or OST object) stores on disk the number of the last transaction in which it was modified. Each reply from the server contains the previous version number of the objects that it affects. During VBR replay, the server matches the previous version numbers in the resend request against the current version number. If the versions match, the request is the next one that affects the object and can be safely replayed. For more information, see <xref linkend="dbdoclet.50438268_80068">Version-based Recovery</xref>.</para>
164     </section>
165     <section remap="h3">
166       <title>30.2.8 Lock Recovery</title>
167       <para>If all requests were replayed successfully and all clients reconnected, clients then do lock replay locks -- that is, every client sends information about every lock it holds from this server and its state (whenever it was granted or not, what mode, what properties and so on), and then recovery completes successfully. Currently, Lustre does not do lock verification and just trusts clients to present an accurate lock state. This does not impart any security concerns since Lustre 1.x clients are trusted for other information (e.g. user ID) during normal operation also.</para>
168       <para>After all of the saved requests and locks have been replayed, the client sends an <literal>MDS_GETSTATUS</literal> request with last-replay flag set. The reply to that request is held back until all clients have completed replay (sent the same flagged getstatus request), so that clients don&apos;t send non-recovery requests before recovery is complete.</para>
169     </section>
170     <section remap="h3">
171       <title>30.2.9 Request Resend</title>
172       <para>Once all of the previously-shared state has been recovered on the server (the target file system is up-to-date with client cache and the server has recreated locks representing the locks held by the client), the client can resend any requests that did not receive an earlier reply. This processing is done like normal request processing, and, in some cases, the server may do reply reconstruction.</para>
173     </section>
174   </section>
175   <section xml:id="dbdoclet.50438268_23736">
176     <title>30.3 Reply Reconstruction</title>
177     <para>When a reply is dropped, the MDS needs to be able to reconstruct the reply when the original request is re-sent. This must be done without repeating any non-idempotent operations, while preserving the integrity of the locking system. In the event of MDS failover, the information used to reconstruct the reply must be serialized on the disk in transactions that are joined or nested with those operating on the disk.</para>
178     <section remap="h3">
179       <title>30.3.1 Required State</title>
180       <para>For the majority of requests, it is sufficient for the server to store three pieces of data in the <literal>last_rcvd</literal> file:</para>
181       <itemizedlist>
182         <listitem>
183           <para> XID of the request</para>
184         </listitem>
185         <listitem>
186           <para> Resulting transno (if any)</para>
187         </listitem>
188         <listitem>
189           <para> Result code (<literal>req-&gt;rq_status</literal>)</para>
190         </listitem>
191       </itemizedlist>
192       <para>For open requests, the &quot;disposition&quot; of the open must also be stored.</para>
193     </section>
194     <section remap="h3">
195       <title>30.3.2 Reconstruction of Open Replies</title>
196       <para>An open reply consists of up to three pieces of information (in addition to the contents of the &quot;request log&quot;):</para>
197       <itemizedlist>
198         <listitem>
199           <para>File handle</para>
200         </listitem>
201         <listitem>
202           <para>Lock handle</para>
203         </listitem>
204         <listitem>
205           <para><literal>mds_body</literal> with information about the file created (for <literal>O_CREAT</literal>)</para>
206         </listitem>
207       </itemizedlist>
208       <para>The disposition, status and request data (re-sent intact by the client) are sufficient to determine which type of lock handle was granted, whether an open file handle was created, and which resource should be described in the <literal>mds_body</literal>.</para>
209       <section remap="h5">
210         <title>Finding the File Handle</title>
211         <para>The file handle can be found in the XID of the request and the list of per-export open file handles. The file handle contains the resource/FID.</para>
212       </section>
213       <section remap="h5">
214         <title>Finding the Resource/fid</title>
215         <para>The file handle contains the resource/fid.</para>
216       </section>
217       <section remap="h5">
218         <title>Finding the Lock Handle</title>
219         <para>The lock handle can be found by walking the list of granted locks for the resource looking for one with the appropriate remote file handle (present in the re-sent request). Verify that the lock has the right mode (determined by performing the disposition/request/status analysis above) and is granted to the proper client.</para>
220       </section>
221     </section>
222   </section>
223   <section xml:id="dbdoclet.50438268_80068">
224     <title>30.4 Version-based Recovery</title>
225     <para>The Version-based Recovery (VBR) feature improves Lustre reliability in cases where client requests (RPCs) fail to replay during recovery
226           <footnote>
227         <para>There are two scenarios under which client RPCs are not replayed:   (1) Non-functioning or isolated clients do not reconnect, and they cannot replay their RPCs, causing a gap in the replay sequence. These clients get errors and are evicted.   (2) Functioning clients connect, but they cannot replay some or all of their RPCs that occurred after the gap caused by the non-functioning/isolated clients. These clients get errors (caused by the failed clients). With VBR, these requests have a better chance to replay because the &quot;gaps&quot; are only related to specific files that the missing client(s) changed.</para>
228       </footnote>.</para>
229     <para>In pre-VBR versions of Lustre, if the MGS or an OST went down and then recovered, a recovery process was triggered in which clients attempted to replay their requests. Clients were only allowed to replay RPCs in serial order. If a particular client could not replay its requests, then those requests were lost as well as the requests of clients later in the sequence. The &apos;&apos;downstream&apos;&apos; clients never got to replay their requests because of the wait on the earlier client&apos;™s RPCs. Eventually, the recovery period would time out (so the component could accept new requests), leaving some number of clients evicted and their requests and data lost.</para>
230     <para>With VBR, the recovery mechanism does not result in the loss of clients or their data, because changes in inode versions are tracked, and more clients are able to reintegrate into the cluster. With VBR, inode tracking looks like this:</para>
231     <itemizedlist>
232       <listitem>
233         <para>Each inode<footnote>
234             <para>Usually, there are two inodes, a parent and a child.</para>
235           </footnote> stores a version, that is, the number of the last transaction (transno) in which the inode was changed.</para>
236       </listitem>
237       <listitem>
238         <para>When an inode is about to be changed, a pre-operation version of the inode is saved in the client&apos;s data.</para>
239       </listitem>
240       <listitem>
241         <para>The client keeps the pre-operation inode version and the post-operation version (transaction number) for replay, and sends them in the event of a server failure.</para>
242       </listitem>
243       <listitem>
244         <para>If the pre-operation version matches, then the request is replayed. The post-operation version is assigned on all inodes modified in the request.</para>
245       </listitem>
246     </itemizedlist>
247     <note>
248       <para>An RPC can contain up to four pre-operation versions, because several inodes can be involved in an operation. In the case of a &apos;&apos;rename&apos;&apos; operation, four different inodes can be modified.</para>
249     </note>
250     <para>During normal operation, the server:</para>
251     <itemizedlist>
252       <listitem>
253         <para> Updates the versions of all inodes involved in a given operation</para>
254       </listitem>
255       <listitem>
256         <para> Returns the old and new inode versions to the client with the reply</para>
257       </listitem>
258     </itemizedlist>
259     <para>When the recovery mechanism is underway, VBR follows these steps:</para>
260     <orderedlist>
261       <listitem>
262         <para>VBR only allows clients to replay transactions if the affected inodes have the same version as during the original execution of the transactions, even if there is gap in transactions due to a missed client.</para>
263       </listitem>
264       <listitem>
265         <para>The server attempts to execute every transaction that the client offers, even if it encounters a re-integration failure.</para>
266       </listitem>
267       <listitem>
268         <para>When the replay is complete, the client and server check if a replay failed on any transaction because of inode version mismatch. If the versions match, the client gets a successful re-integration message. If the versions do not match, then the client is evicted.</para>
269       </listitem>
270     </orderedlist>
271     <para>VBR recovery is fully transparent to users. It may lead to slightly longer recovery times if the cluster loses several clients during server recovery.</para>
272     <section remap="h3">
273       <title>30.4.1 VBR Messages</title>
274       <para>The VBR feature is built into the Lustre recovery functionality. It cannot be disabled. These are some VBR messages that may be displayed:</para>
275       <screen>DEBUG_REQ(D_WARNING, req, &quot;Version mismatch during replay\n&quot;);</screen>
276       <para>This message indicates why the client was evicted. No action is needed.</para>
277       <screen>CWARN(&quot;%s: version recovery fails, reconnecting\n&quot;);</screen>
278       <para>This message indicates why the recovery failed. No action is needed.</para>
279     </section>
280     <section remap="h3">
281       <title>30.4.2 Tips for Using VBR</title>
282       <para>VBR will be successful for clients which do not share data with other client. Therefore, the strategy for reliable use of VBR is to store a client&apos;s data in its own directory, where possible. VBR can recover these clients, even if other clients are lost.</para>
283     </section>
284   </section>
285   <section xml:id="dbdoclet.50438268_83826">
286     <title>30.5 Commit on Share</title>
287     <para>The commit-on-share (COS) feature makes Lustre recovery more reliable by preventing missing clients from causing cascading evictions of other clients. With COS enabled, if some Lustre clients miss the recovery window after a reboot or a server failure, the remaining clients are not evicted.</para>
288     <note>
289       <para>The commit-on-share feature is enabled, by default.</para>
290     </note>
291     <section remap="h3">
292       <title>30.5.1 Working with Commit on Share</title>
293       <para>To illustrate how COS works, let&apos;s first look at the old recovery scenario. After a service restart, the MDS would boot and enter recovery mode. Clients began reconnecting and replaying their uncommitted transactions. Clients could replay transactions independently as long as their transactions did not depend on each other (one client&apos;s transactions did not depend on a different client&apos;s transactions). The MDS is able to determine whether one transaction is dependent on another transaction via the <xref linkend="dbdoclet.50438268_80068"/> feature.</para>
294       <para>If there was a dependency between client transactions (for example, creating and deleting the same file), and one or more clients did not reconnect in time, then some clients may have been evicted because their transactions depended on transactions from the missing clients. Evictions of those clients caused more clients to be evicted and so on, resulting in &quot;cascading&quot; client evictions.</para>
295       <para>COS addresses the problem of cascading evictions by eliminating dependent transactions between clients. It ensures that one transaction is committed to disk if another client performs a transaction dependent on the first one. With no dependent, uncommitted transactions to apply, the clients replay their requests independently without the risk of being evicted.</para>
296     </section>
297     <section remap="h3">
298       <title>30.5.2 Tuning Commit On Share</title>
299       <para>Commit on Share can be enabled or disabled using the <literal>mdt.commit_on_sharing</literal> tunable (0/1). This tunable can be set when the MDS is created (<literal>mkfs.lustre</literal>) or when the Lustre file system is active, using the <literal>lctl set/get_param</literal> or <literal>lctl conf_param</literal> commands.</para>
300       <para>To set a default value for COS (disable/enable) when the file system is created, use:</para>
301       <screen>--param mdt.commit_on_sharing=0/1
302 </screen>
303       <para>To disable or enable COS when the file system is running, use:</para>
304       <screen>lctl set_param mdt.*.commit_on_sharing=0/1
305 </screen>
306       <note>
307         <para>Enabling COS may cause the MDS to do a large number of synchronous disk operations, hurting performance. Placing the <literal>ldiskfs</literal> journal on a low-latency external device may improve file system performance.</para>
308       </note>
309     </section>
310   </section>
311 </chapter>