Loading TOC...

MarkLogic Server 11.0 Product Documentation
flexrep:domain-target-reset

flexrep:domain-target-reset(
   $domain-id as xs:unsignedLong,
   $target-ids as xs:unsignedLong*,
   [$errors-only as xs:boolean]
) as empty-sequence()

Summary

This function resets the domain for the specified replication targets. A reset involves retaining any record of last success, clearing any failure status, and setting the time for the next replication attempt to the current time. The status is reset for the specified $target-ids .

Resetting the domain for a target is useful if the target has errored out due to too many failures, or if you want to replicate the documents again.

Note that the reset is limited to 5,000,000 documents per forest, so this function may not reset the whole domain. Reinvoking this function does not reset an additional 5,000,000 documents.

Parameters
domain-id The ID of the replicated domain.
target-ids The ID of the replication target.
errors-only When set to true, only reset the status for documents with errors. The default is false.

Example

  xquery version "1.0-ml"; 

  import module namespace flexrep = "http://marklogic.com/xdmp/flexible-replication" 
      at "/MarkLogic/flexrep.xqy";

  (: Obtain the domain ID from the database used by the Master to enable CPF. :)
  let $domain := xdmp:eval(
        'xquery version "1.0-ml";
         import module namespace dom = "http://marklogic.com/cpf/domains" 
            at "/MarkLogic/cpf/domains.xqy";
         fn:data(dom:get( "Replicated Content" )//dom:domain-id)',
         (),
         <options xmlns="xdmp:eval">
            <database>{xdmp:database("MyTriggers")}</database>
         </options>)
 
  let $cfg := flexrep:configuration-get($domain, fn:true())
  let $target-id := flexrep:configuration-target-get-id($cfg, "Replica")

  return flexrep:domain-target-reset($domain, ($target-id))

  (: Resets the URI status for the "Replica" target. :)
     

Required Privileges

http://marklogic.com/xdmp/privileges/flexrep-admin

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.