<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="clone-plugin-failure-handling">
      </a>
      7.6.7.9 Remote Cloning Operation Failure Handling
     </h4>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045255340368">
  </a>
  <p>
   This section describes failure handing at different stages of a
        cloning operation.
  </p>
  <div class="orderedlist">
   <ol class="orderedlist" type="1">
    <li class="listitem">
     <p>
      Prerequisites are checked (see
      <a class="xref" href="clone-plugin-remote.html#clone-remote-prerequisites" title="Remote Cloning Prerequisites">
       Remote Cloning Prerequisites
      </a>
      ).
     </p>
     <div class="itemizedlist">
      <ul class="itemizedlist" style="list-style-type: disc; ">
       <li class="listitem">
        <p>
         If a failure occurs during the prerequisite check, the
         <a class="link" href="clone.html" title="15.7.5 CLONE Statement">
          <code class="literal">
           CLONE
                INSTANCE
          </code>
         </a>
         operation reports an error.
        </p>
       </li>
      </ul>
     </div>
    </li>
    <li class="listitem">
     <p>
      Concurrent DDL on the donor is blocked only if the
      <a class="link" href="clone-plugin-options-variables.html#sysvar_clone_block_ddl">
       <code class="literal">
        clone_block_ddl
       </code>
      </a>
      variable is
            set to
      <code class="literal">
       ON
      </code>
      (the default setting is
      <code class="literal">
       OFF
      </code>
      ). See
      <a class="xref" href="clone-plugin-concurrent-ddl.html" title="7.6.7.4 Cloning and Concurrent DDL">
       Section 7.6.7.4, “Cloning and Concurrent DDL”
      </a>
      .
     </p>
     <p>
      If the cloning operation is unable to obtain a DDL lock
            within the time limit specified by the
      <a class="link" href="clone-plugin-options-variables.html#sysvar_clone_ddl_timeout">
       <code class="literal">
        clone_ddl_timeout
       </code>
      </a>
      variable,
            an error is reported.
     </p>
    </li>
    <li class="listitem">
     <p>
      User-created data (schemas, tables, tablespaces) and binary
            logs on the recipient are removed before data is cloned to
            the recipient data directory.
     </p>
     <p>
      When user-created data and binary logs are removed from the
            recipient data directory during a remote cloning operation,
            the data is not saved and may be lost if a failure occurs.
            If the data is of importance, a backup should be taken
            before initiating a remote cloning operation.
     </p>
     <p>
      For informational purposes, warnings are printed to the
            server error log to specify when data removal starts and
            finishes:
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa56265458"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal"><span class="token punctuation">[</span>Warning<span class="token punctuation">]</span> <span class="token punctuation">[</span>MY-013453<span class="token punctuation">]</span> <span class="token punctuation">[</span>InnoDB<span class="token punctuation">]</span> Clone removing all user data for provisioning<span class="token punctuation">:</span>
Started<span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>

<span class="token punctuation">[</span>Warning<span class="token punctuation">]</span> <span class="token punctuation">[</span>MY-013453<span class="token punctuation">]</span> <span class="token punctuation">[</span>InnoDB<span class="token punctuation">]</span> Clone removing all user data for provisioning<span class="token punctuation">:</span>
Finished</code></pre>
     </div>
     <p>
      If a failure occurs while removing data, the recipient may
            be left with a partial set of schemas, tables, and
            tablespaces that existed before the cloning operation. Any
            time during the execution of a cloning operation or after a
            failure, the server is always in a consistent state.
     </p>
    </li>
    <li class="listitem">
     <p>
      Data is cloned from the donor. User-created data, dictionary
            metadata, and other system data are cloned.
     </p>
     <p>
      If a failure occurs while cloning data, the cloning
            operation is rolled back and all cloned data removed. At
            this stage, the previously existing user-created data and
            binary logs on the recipient have also been removed.
     </p>
     <p>
      Should this scenario occur, you can either rectify the cause
            of the failure and re-execute the cloning operation, or
            forgo the cloning operation and restore the recipient data
            from a backup taken before the cloning operation.
     </p>
    </li>
    <li class="listitem">
     <p>
      The server is restarted automatically (applies to remote
            cloning operations that do not clone to a named directory).
            During startup, typical server startup tasks are performed.
     </p>
     <p>
      If the automatic server restart fails, you can restart the
            server manually to complete the cloning operation.
     </p>
    </li>
   </ol>
  </div>
  <p>
   If a network error occurs during a cloning operation, the
        operation resumes if the error is resolved within the time
        specified by the
   <a class="link" href="clone-plugin-options-variables.html#sysvar_clone_donor_timeout_after_network_failure">
    <code class="literal">
     clone_donor_timeout_after_network_failure
    </code>
   </a>
   variable defined on the donor instance. The
   <a class="link" href="clone-plugin-options-variables.html#sysvar_clone_donor_timeout_after_network_failure">
    <code class="literal">
     clone_donor_timeout_after_network_failure
    </code>
   </a>
   default setting is 5 minutes but a range of 0 to 30 minutes is
        supported. If the operation does not resume within the allotted
        time, it aborts and returns an error, and the donor drops the
        snapshot. A setting of zero causes the donor to drop the
        snapshot immediately when a network error occurs. Configuring a
        longer timeout allows more time for resolving network issues but
        also increases the size of the delta on the donor instance,
        which increases clone recovery time as well as replication lag
        in cases where the clone is intended as a replica or replication
        group member.
  </p>
  <p>
   The Clone idle timeout is set to the default
   <a class="link" href="server-system-variables.html#sysvar_wait_timeout">
    <code class="literal">
     wait_timeout
    </code>
   </a>
   setting, which is
        28800 seconds (8 hours).
  </p>
 </div>
 <br/>
</div>
