Home / Repstance User Guide / PROCESS CONTROL COMMANDS

PROCESS CONTROL COMMANDS

The process control commands run and stop the Capture Processes and the Apply Processes, show their state, move a process to another position and report what a process has done. The processes themselves are created and changed with the commands of PROCESS CONFIGURATION COMMANDS.

The commands

CommandWhat it doesPage
runStarts a Capture Process or an Apply Process, all the processes of one kind, or all the processes.Run any Capture or Apply Processes
stopStops them. With restart=1 a process is stopped and run again.Stop any Capture or Apply Processes
statusShows the state of the processes and what they have done since they were started.Status of any Capture or Apply Processes
resetSets the position from which a process continues the next time it is run.Reset Process
reportShows, for every table, the inserts, updates, deletes, DDL statements and loaded rows that a process has handled.Report Process

Every command is available in repcli, in the REST API and in the Web UI. The pages above describe all three.

One process, one kind or all

The commands run, stop and status work with one process, with all the processes of one kind, or with all the processes. What you write decides:

You writeThe command works with
repcli runEvery Capture Process and every Apply Process
repcli run process=captureEvery Capture Process
repcli run process=capture id=1The Capture Process 1 only

stop and status take the same parameters: repcli stop process=apply stops every Apply Process, repcli status process=apply id=2 shows the Apply Process 2. reset and report always name one process.

  • process is capture or apply, id is the identifier of the process. process has to come first, id without process is refused. The names of the parameters and the value of process are not case sensitive.
  • A command is sent to a process only when its state allows it: run to a process that is not running, stop to a process that is running or has failed. For any other process the answer is Failed with the message Command [RUN] is not valid for this status, and the other processes still get the command.
  • The commands return at once. The process starts or stops a moment later: use status to follow it.

repcli also accepts capture=1 or apply=2 in place of process=capture id=1 and process=apply id=2, and status capture in place of status process=capture:

repcli run capture=1repcli stop apply=2repcli status capture

Messages

repcli prints the message of every process the command is meant for as [Failed]: message or [In Process]: message. The messages of a command that cannot be carried out:

MessageCause
An invalid parameter [id] has been supplied and Valid parameter is [process]id without process, or another parameter in the place of process. The parameters have to be given in the order process, id.
An invalid value [foo] has been supplied for parameter [process] and Valid values are: apply|captureThe value of process is not apply or capture.
An invalid value [abc] has been supplied for parameter [id]The value of id is not a number, or it is 0.
Process id=9 does not existThere is no process of this kind with this id.
Capture 1 Process status is [In Process]. Command [RUN] is not valid for this statusThe process is not in a state that accepts the command: it is running already (run), or it is stopped already (stop, the status is then Completed).

REST API

The commands run, stop and status are POST requests to /control/process, reset goes to /reset/process and report to /report/process. The body is JSON and the request carries the header X-Token with the token of the Repstance server (see Configure repcli for Remote Access and REST API). The bodies and the answers are described on the pages of the commands. The HTTP codes of run, stop and status:

HTTP codeMeaning
200The request is valid. The body has an element for every process the command is meant for, with the status In Process or Failed.
401The token is invalid.
422The request is invalid: the JSON, the command, a parameter, or the process does not exist. The body has one element with the status Failed and the message.

Web UI

The dashboard has the buttons “Run All Processes” and “Stop All”, and “Run” or “Stop” on the card of every process. The state of a process is on its card and in the window of “More”. They are described in Stop/Run Replication Processes and Monitoring Replication. The reset of a process and the report of its transactions are in the window of “More” too, see Reset Process and Report Process.