Loading TOC...

MarkLogic 10 Product Documentation
flexrep.domainTargetReset

flexrep.domainTargetReset(
   domain-id as (Number|String),
   target-ids as (Number|String)[],
   [errors-only as Boolean]
) as null

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 targetIds .

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

const flexrep = require('/MarkLogic/flexrep');

  // Obtain the domain ID from the database used by the Master to enable CPF.
  const domain = xdmp.eval(
    'const dom = require("/MarkLogic/cpf/domains");' +
      'fn.data(dom.get("Default Master").xpath("//dom:domain-id"));',
       null,
         {
          'database' : xdmp.database('Triggers')
         });
 
   const cfg = flexrep.configurationGet(domain, true);
   const targetId = flexrep.configurationTargetGetId(cfg, 'Replica');

  flexrep.domainTargetReset(domain, targetId);

  // 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.