Read-only and partitioned clients in automated builds
Build automation scripts frequently create, sync, and tear down
clients. This can fragment the
db.have table, which can cause your end-users to experience slower sync operations. To avoid
this problem, consider adding one or more additional client workspaces of type
readonly or partitioned for the exclusive use of automated builds.
Readonly and Partitioned Clients
Client workspaces of type
partitioned have their own
db.have database table that is not journaled and is easily removed when the client workspace is deleted, thus preventing fragmentation of the
db.have table. These types of client workspaces are ideal for the build automation cycle that creates a client workspace, syncs it with the depot, performs builds, and finally deletes the client workspace.
readonly client workspaces for short lived client workspaces used for build automation where editing and submitting files is not required. Typical commands run from a readonly client workspace:
partitioned client workspaces for the same purpose as
readonly client workspaces, but with the additional ability to edit and submit files. Typical commands run from a partitioned client workspace, in addition to the the
readonly commands above:
Creating a readonly or a partitioned client workspace
Before creating a
readonly client workspace or a
partitioned client workspace, configure the storage location for the
db.have tables of these types of client workspaces by setting the client.readonly.dir server configurable. For example:
p4 configure set client.readonly.dir=part-db-have
Although the name of this configurable contains "readonly", its setting also applies to partitioned client workspaces.
Relative paths specified in
client.readonly.dir are relative to P4ROOT, but absolute paths can also be specified. The client.readonly.dir server configurable does not require a server restart. The Helix Server creates the directory upon first usage, if it doesn't already exist.
To create a client workspace that is
partitioned, set the
Type: field in the client specification to either
p4 client my-readonly-client ... Type: readonly
p4 client my-partitioned-client ... Type: partitioned
readonly client cannot be changed into a
writeable client, a readonly client can be converted to a partitioned client by updating the
Type: field in the client specification. See p4 client > Options >
-T type in Helix Core Command-Line (P4) Reference.
p4 changes -m1 @partitioned-client-name
p4 fstat #havefrom a
partitionedclient against a forwarding replica
Can't use p4 switch from a
p4 sync @partitioned-client-nameis equivalent to
The db.working and
db.havecheck performed by
p4d -xxignores the
db.havetables for partitioned client workspaces. This results in the creation of
jnl.fixrecords to delete the partitioned client's
db.workingrecords for any open file revisions. Before replaying a
jnl.fixfile, contact Technical Support.