Helix Core Server Administrator Guide: Multi-Site Deployment (2019.1)

Testing the replica

Testing p4 pull

To confirm that the p4 pull commands (specified in the Replica1 startup.N configurations) are running, issue the following command:

$ p4 -u super -p replica:22222 monitor show -a
18835 R service00:04:46 pull -i 1
18836 R service00:04:46 pull -u -i 1
18837 R service00:04:46 pull -u -i 1
18926 R super 00:00:00 monitor show -a

If you need to stop replication for any reason, use the p4 monitor terminate command:

$ p4 -u super -p replica:22222 monitor terminate 18837 process '18837' marked for termination 

To restart replication, either restart the Helix server process, or manually restart the replication command:

$ p4 -u super -p replica:22222 pull -u -i 1
Note

If the p4 pull and/or p4 pull -u processes are terminated, read-only commands continue to work for replica users as long as the replica server’s p4d is running.

Testing file replication

Create a new file under your workspace view:

$ echo "hello world" > myfile

Mark the file for add:

$ p4 -p master:11111 add myfile

And submit the file:

$ p4 -p master:11111 submit -d "testing replication"

Wait a few seconds for the pull commands on the replica to run, then check the replica for the replicated file:

$ p4 -p replica:22222 print //depot/myfile
//depot/myfile#1 - add change 1 (text)
hello world

If a file transfer is interrupted for any reason, and a versioned file is not present when requested by a user, the replica server silently retrieves the file from the master.

Verifying the replica

When you copied the versioned files from the master server to the replica server, you relied on the operating system to transfer the files. To determine whether data was corrupted in the process, run p4 verify on the replica server:

$ p4 verify //...

Any errors that are present on the replica but not on the master indicate corruption of the data in transit or while being written to disk during the original copy operation.

Tip

Run p4 verify on a regular basis because any server’s storage is vulnerable to corruption.

Next step

Using the replica