p4 servers

Display list of all server specifications or evaluate replication status.

A user with operator privileges can 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 central server The one server that is innermost in a multi-server deployment. In the server specification form field for Services, the central server might be specified as “standard” or “commit-server”. If edge servers are part of the multi-server deployment, the central server must be a commit server. See also 'upstream 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 by including the -ztag option (see Global options):

p4 -ztag servers

Copy
... 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

The Options and ReplicationFrom fields that appear in tagged output (line 26-27 and 35-36) are related to the failover feature. To learn more, 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 target 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 target server 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 target server as the target. A standby server can replicate target server records using two operations:

  • It uses the p4 journalcopy command to copy (persist) the target 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 target server. 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:

Copy
... 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

Form fields

Field Description

ServerID

The server ID of the server.

Updated

The date and time the requesting server last requested journal records from this server.

ServerType

Server executable type. One of the following:

Type Notes
server declares a server instance
proxy declares a P4P instance
broker declares a P4Broker instance
connector declares a git-connector instance

Each type can offer one or more services.

PersistedJournal

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

PersistedSequence

The persisted journal position. The persisted and applied positions are always the same unless the server is a standby server. See AppliedSequence.

AppliedJournal

The rotation number of the applied journal.

AppliedSequence

The applied journal position. The persisted and applied positions are always the same unless the server is a standby server. See PersistedSequence.

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 local 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 if they are made from a replica that has a serverID (or a P4NAME, which is deprecated).

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