## Replication Commands

Replication commands are invoked from the environment handle, after it has been opened with the appropriate flags defined here.

> <env> rep_process_message machid control rec

This command processes a single incoming replication message. It is a direct translation of the rep_process_message function. It returns either a 0 (for success), a DB error message or it throws a Tcl error with a system message. The arguments are:

- machid is the machine ID of the machine that sent this message.
- control is a binary string containing the exact contents of the control argument to the sendproc function that was passed this message on another site.
- rec is a binary string containing the exact contents of the rec argument to the sendproc function that was passed this message on another site.

> <env> rep_elect nsites pri wait sleep

This command causes a replication election. It is a direct translation of the rep_elect function. Its arguments, all integers, correspond exactly to that C function's parameters. It will return a list containing two integers, which contain, respectively, the integer values returned in the C function's midp and selfp parameters.