MarkLogic Server 11.0 Product Documentation
flexrep.pushLocalForest

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

Summary

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.

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

Example

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"));',
       null,
         {
          '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

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

Powered by MarkLogic Server | Terms of Use | Privacy Policy