Client workspace types
Performance might benefit from the use of client workspaces of type readonly, partitioned, or partitioned-jnl.
When to use which type
-
By default, clients are created with the type
writeable, and theTypefield is not shown in the spec. -
The P4 Server uses a central
db.havetable to track the have list The list of file revisions most recently synced from the depot into the workspace. In other words, the list of files that the client workspace has. forwriteableclients. However, when many clients syncing a large number of files at the same time, the central table is subject to contention. -
Other client types can reduce this contention because, for them, P4 Server uses client-specific
db.have.pttables that are independent of the centraldb.havetable. To enable this feature, an administrator uses theclient.readonly.dirconfigurable to set the location on the server for the independentdb.havetables.
| Type | Independent db.have.pt table? |
Journaled, checkpointed, and recoverable? | Use case |
writeable
|
No | Yes |
For general use. |
partitioned-jnl
|
Yes | Yes | For general use in situations where client workspaces might otherwise experience contention for the server's central db.have table. |
readonly
|
Yes | No | For short lived clients used in build automation scripts that do not edit or submit files. |
partitioned
|
Yes | No |
For short lived clients used in build automation scripts that do edit or submit files. |
graph
|
No | Yes | For use with depots and repos of type graph and Git Connector. To learn more, see Work with Git. |
Replication
Replication is supported for the client types that are journaled, checkpointed, and recoverable.
Converting client types
Converting a client workspace between writeable and a client type that uses an independent db.have.pt table (readonly, partitioned, or partitioned-jnl) transfers the workspace have list records.
The following table summarizes how db.have and db.have.pt records are handled during client type conversions.
| To writeable | To graph | To readonly | To partitioned | To partitioned-jnl | |
|---|---|---|---|---|---|
| From writeable | Not applicable | If no open files and not a stream client | If no open files | Allowed | Allowed |
| From graph | If no open files | Not applicable | Not allowed | Not allowed | Not allowed |
| From readonly | Allowed | Not allowed | Not applicable | Allowed | Allowed |
| From partitioned | Allowed | Not allowed | If no open files | Not applicable | Allowed |
| From partitioned-jnl | Allowed | Not allowed | If no open files | Allowed | Not applicable |
Have table behavior during client type conversion
Graph clients are not included in this table because they do not use the db.have or db.have.pt tables. Conversions to and from graph clients therefore do not involve have table migration or journaling changes.
No record changes indicates that existing db.have.pt records are retained. No records are added or removed. Only the journaling behavior of the db.have.pt table changes.
| To writeable | To readonly | To partitioned | To partitioned-jnl | |
|---|---|---|---|---|
| From writeable | Not applicable |
Journaled → Not journaled |
Journaled → Not journaled |
Journaled → Journaled |
| From readonly |
Not journaled → Journaled |
Not applicable |
No record changes. |
No record changes. Journaling enabled. |
| From partitioned | db.have.pt: remove rows
Not journaled → Journaled |
No record changes. | Not applicable |
No record changes. Journaling enabled. |
| From partitioned-jnl |
Journaled for replication → Journaled |
No record changes. Journaling disabled. |
No record changes. Journaling disabled. |
Not applicable |
Limitations and capabilities
Clients of type readonly, partitioned, and partitioned-jnl are allowed to be unloaded and reloaded. The deletion entries and notes are journaled for partitioned-jnl but not for readonly or partitioned.
The p4 journaldbchecksums command works for partitioned-jnl but not for readonly or partitioned because this command updates journal entries.
Clients of type readonly, partitioned, and partitioned-jnl support the p4d -xx, p4 dbverify, and p4d -xv commands, which read, but do not update, the database tables.
You can also minimize contention to a central have list The list of file revisions most recently synced from the depot into the workspace. In other words, the list of files that the client workspace has. by using the commitCommit-edge overview architecture because each edge server has its own db.have table that is separate from the commit server's central db.have table.
Typical commands and readonly, partitioned, and partitioned-jnl clients
| readonly | partitioned | partitioned-jnl |
|---|---|---|
|
For build automation, where editing and submitting files is not required, consider |
Use |
A |
Creating a readonly, partitioned, or partitioned-jnl client workspace
Before creating a client workspace of type readonly, partitioned, or partitioned-jnl, configure the storage location for the independent db.have.pt table 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 applies to the readonly, partitioned, and partitioned-jnl types.
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. P4 Server creates the directory upon first usage if it doesn't already exist.
To create a client workspace that is readonly, partitioned, or partitioned-jnl, set the Type field in the client specification to readonly, partitioned, or partitioned-jnl.
For example,
p4 client my-readonly-client ... Type: readonly
or
p4 client my-partitioned-client ... Type: partitioned
or
p4 client my-partitioned-jnl-client ... Type: partitioned-jnl
partitioned, partitioned-jnl, and readonly client workspaces must not exceed 246 bytes after P4 Server converts them into internal file names (characters such as % and / are encoded and count for more than one byte). If the converted name exceeds the limit, saving the client spec fails with an error. Standard, writeable client workspaces are not subject to this limit.Commands for partitioned have tables
The p4d -jd command also works with partitioned db.have tables. See Journal dump and restore filtering.