p4 servers

Display list of all server specifications or evaluate replication status.

A user with operator privileges may execute p4 servers and p4 servers -J.

Syntax

p4 [g-opts] servers [-J | --replication-status]

Syntax conventions

Description

Syntax variants are described in the following subsections.

Listing server specifications

p4 servers lists all server specifications stored at a master Helix Server.

edge-server_1 server edge-server_1 10.0.101.55:41261 edge-server 'edge-server '
edge-server_2 server edge-server_2 10.0.101.55:47050 edge-server 'edge-server '

Output lists the server ID, the type, the services provided, and the description supplied when the server was created.

The output of p4 servers is easier to parse if you retrieve it in tagged form:

p4 -ztag servers

... ServerID commit-1
... Name
... Address
... Type server ... Services commit-server ... Options nomandatory ... Description commit-1 ... ServerID edge-server-1 ... Name ... Address ... Type server ... Services edge-server ... Options nomandatory ... Description edge-server-1 ... ServerID edge-server-2 ... Name ... Address ... Type server ... Services edge-server ... Options nomandatory ... Description edge-server-2 ... ServerID remote-standby ... Name ... Address ... Type server ... Services standby ... Options nomandatory ... ReplicatingFrom commit-1 ... Description Remote DR server ... ServerID standby-1 ... Name ... Address ... Type server ... Services standby ... Options mandatory ... ReplicatingFrom commit-1 ... Description Local HA server
Note

The Options and ReplicationFrom fields that appear in tagged output are related to the failover feature. See p4 failover.

Evaluating replication status

Using the -J or --replication-status option allows you to check how efficiently one or more replicas are replicating the master server’s records. Given a server A and a replica B, output for this command gives you two basic pieces of information:

  • The size and update time of A's journal.
  • For every server, B, that has sent a p4 pull or p4 journalcopy request, information is given as to when that request was sent and what is the persisted and applied state of B's journal. (In the case of a simple master and replica, the persisted and applied numbers are always the same: B's journal is updated by the p4 pull command.

This assumes that the command is executed with the master server as the target. A standby server can replicate master server records using two operations:

  • It uses the p4 journalcopy command to copy (persist) the master server’s journal to the standby’s journal.
  • It uses the p4 pull -L command to apply the copied journal records to the standby’s database and to update its state file.

You can look at the output to evaluate the load on various parts of your multi-server system and to see how well your replicas are keeping up with the master. Growing lag times might be a reason for concern.

The untagged output of p4 servers -J looks like this:

edge-server_1 '2014/09/18 13:14:58' edge-server 5/258 5/258 WaDl/10 1
edge-server_2'2014/09/18 13:14:57' edge-server 5/258 5/258 WaDl/10 1

It is easier to interpret this output in tagged form:

... ServerID edge-server_1
... Updated 2014/09/18 13:14:58
... ServerType edge-server
... PersistedJournal 5
... PersistedSequence 258
... AppliedJournal 5
... AppliedSequence 258
... JAFlags WaDl/10 1
... IsAlive 1

... ServerID edge-server_2
... Updated 2014/09/18 13:14:57
... ServerType edge-server
... PersistedJournal 5
... PersistedSequence 258
... AppliedJournal 5
... AppliedSequence 258
... JAFlags WaDl/10 1
... IsAlive 1

The meaning of the fields are described in the following table.

ServerID

The server ID of the server.

Important

To avoid configuration problems, the value of serverID should always match the value of P4NAME if both are set. We recommend setting serverID, but support P4NAME for backward compatibility.

Updated

The date and time the requesting server last requested journal records from this server (normally the master).

ServerType

The server type. One of the following: standard, replica, forwarding-replica, build-server, edge-server, commit-server, depot-master, depot-standby, standby, forwarding-standby.

PersistedJournal

The rotation number of the journal to which records are being persisted.

PersistedSequence

The persisted journal position.

For master servers, replicas, and workspace servers, the persisted and applied positions are always the same. They differ only for all types of standby servers.

AppliedJournal

The rotation number of the applied journal.

AppliedSequence

The applied journal position.

For master servers, replicas, and workspace servers, the persisted and applied positions are always the same.

JAFlags

Set of fields printed in upper-case if set or lower-case if not. The numeric value of the flags is displayed after the alphabetic display.

Common field displays with their associated pull or journalcopy commands are as follows:

  • WAdl/12: p4 journalcopy -i 0
  • WaDl/10: p4 pull -i 0
  • wAdl/4: p4 journalcopy -i 1
  • waDl/2: p4 pull -i 1
  • wadL/1: synthesized record for master status. You can compare the journal positions of each replica with that of this server to see if any replica is falling behind.

Symbols are to be interpreted as follows:

  • W/8: wait, long-poll request
  • w: no wait
  • A/4: Acknowledging
  • a: non-acknowledging
  • D/2: durable
  • d: non-durable
  • L/1: data about the local journal; that is, the journal of the server that is the target of the p4 servers command.
  • l: request from a replica (shows progress in copying master’s journal).

IsAlive

1 if the server is up; 0 if it’s down.

Pull or journal-copy requests are recorded in the db.jnlack table only when made from a replica that has either a server ID or a P4NAME. Any replica that makes such a request but does not have a server ID or P4NAME is not recorded in the table.

Options

-J | --replication-status

Provides information about the server’s journal and about the replication status of all replicas that replicate from this server.

g-opts

See Global options.

Usage Notes

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

N/A

N/A

list

an operator user can run p4 servers and p4 servers -J

Related Commands

To edit or view a server specification

p4 server

To set a server’s unique ID

p4 serverid