Loading TOC...


   domain-id as (Number|String),
   forest-id as (Number|String),
   max-spawn as (Number|String)
) as null


This function pushes pending replication updates (either retries or zero-day) for the specified forest on the current host. If any updates are found, a new task is spawned to call this function again. This continues until all pending replication updates have been processed.

domain-id The ID of the replicated domain.
forest-id The ID of the replicated forest.
max-spawn The limit to the number of doable spawns. If a task respawns itself too many times, a spawn will eventually fail with an exception.


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

    const domain = xdmp.eval(
    'const dom = require("/MarkLogic/cpf/domains");' +
      'fn.data(dom.get("Default Master").xpath("//dom:domain-id"));',
          'database' : xdmp.database('Triggers')

   const cfg = flexrep.configurationGet(domain, true);
   const domainId = flexrep.configurationGetId(cfg);
   const forestId =  
      admin.forestGetId(admin.getConfiguration(), "Master-forest");

  flexrep.pushLocalForest(domainId, forestId, 10);
  // Pushes all pending replication updates from the "Master-forest" forest on the host.

Required Privileges


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