Replication checks
When you set up and test replication, be aware of:
For replication checks:
-
Replica A P4 Server that automatically maintains a full or partial copy of the central server's metadata and that might contain related file content. The replica copies by using 'p4 pull' or 'p4 journalcopy'. A replica can be used as a backup server for disaster recovery. refers to edge servers as well as replica servers.
-
Target server The immediately upstream server for replica servers, edge servers, standby servers, proxies and brokers. See also 'upstream server' and 'central server'. refers to the server that is established by the replica's
P4TARGETenvironment variable.
What the replica server checks at startup
When a replica server is started, it checks to ensure the setting of its lbr.replication configurable is correct for the environment in which it is running. If the setting of lbr.replication is incompatible with the storage in the environment, the replica's log file indicates the error:
|
Storage incompatibility |
Replica log file error |
|---|---|
|
Storage is shared between the replica and the target server, but |
|
|
Storage is not shared between the replica and the target server, but |
|
The replica's pull or journalcopy thread checks whether its depots are shared with its target server.
The exceptions to this rule are that Archive depots and Remote depots are not checked because they are not routinely replicated. To learn about remote depots, see Remote depots and multi-server development.
How the replica checks for shared storage at startup
To check for shared storage at startup, the replica uses temporary binary files in the format described at Versioned file formats.
-
The replica creates a temporary binary file in each of its depots with the format:
depot-name/PerforceServerIdentities/server-id,d/1.1
For example,Project1/PerforceServerIdentities/EdgeServer3,d/1.1where
Project1is a depot,PerforceServerIdentitiesis the specific directory used for this check, andEdgeServer3,d/1.1is the binary file storage for theEdgeServer3file that identifies this replica. -
The replica requests that the target server check if it can locate this file in each of its depots.
-
When the checks are done, the replica deletes the
PerforceServerIdentitiesdirectory and its contents.
Service user super access to all depots
To create the PerforceServerIdentities files required for the checks, the service user configured for the replica must have super access to all depots. To learn more, see Permissions for service users under Types of users in P4 CLI Reference.
Ensure the service user protections are at the bottom of the protections table so later lines don't potentially remove required access. To learn more, see How protections are implemented.
If the service user doesn't have proper access, the replica log on startup might contain errors. For example:
//jam/PerforceServerIdentities/commit-standby - no permission for operation on file(s). //jam/PerforceServerIdentities/commit-standby - must refer to client 'pluto'.
Guidelines for special situations
When setting up and testing replication, consider these guidelines:
|
Situation |
Guideline |
|
Absolute map path |
Depots that use absolute depot map paths must have those paths checked to be compatible with the |
|
Graph and extension depots |
The
|
|
Shared |
Where there are no absolute depot mappings and the storage is shared, the relative location of the depots can be set on both the target server and replica by using:
Alternatively, set the replica’s |
|
Use of a file transfer utility |
When replicas are using a file transfer utility such as |