p4 journalcopy

Copies journal data from a master server to the local file system of a standby replica. The copy is identical, byte-for-byte, to the original.

Displays information about the current copy position.

Syntax

p4 [g-opts] journalcopy -l
p4 [g-opts] journalcopy [-i n] [-b wait]

Description

The p4 journalcopy provides two syntax variants:

Obtaining the current copy position

An operator may run the p4 journalcopy -l, p4 pull -l -j, and p4 pull -l -s commands. This makes it possible for an operator to confirm the state of a replica.

The output of the p4 journalcopy -l command is shown below. The sequence number indicates the offset position in the journal that the copy has reached.

Current replica persisted journal state is: Journal 2, Sequence 6510347

You can compare this offset with the output for the p4 pull -l command for the replica. The latter indicates the offset position in the journal that has been written to the database.

Copying journal records

In order for a standby replica to take over for the master server, it must have a copy of the master server’s metadata and access to versioned files. To do this, you must run the following commands:

The combination of the p4 journalcopy command and the p4 pull -L command accomplish the same result as using the p4 pull command, with the following differences:

The p4 journalcopy command runs quickly, so journal records can be transferred from the master server to the standby replica with minimal lag or overhead on the master server.

By default, when p4 journalcopy detects an error with its connection to the master, it waits for one (1) second and then attempts to reconnect and resume transferring journal records. In this example, we change the wait value after an error to two (2) seconds:

$ p4 -p depot_master_p4port configure set standby#startup.1 = journalcopy -i 0 -b 2

Options

-b wait

Wait the specified number of seconds to retry the p4 journalcopy command after a failed attempt.

-i n

Repeat the p4 journalcopy command every n seconds. If you do not use this option, the command runs once.

If you set n to 0, the command will run as frequently as possible rather than sleeping between runs.

-l

Report on the current position in the copied journal.

g-opts

See Global Options.

Usage Notes

Can File Arguments Use Revision Specifier? Can File Arguments Use Revision Range? Minimal Access Level Required

NA

NA

super

Examples

p4 journalcopy -l

Show information about the current copy position from the master’s journal to the replica’s journal.

Related Commands

To make a copy of the master’s versioned files.

p4 pull -u

To get information about replication status from the point of view of the master server, use the -J option of the p4 servers command.

p4 servers