[p4] Need to make the P4 Sever 24 x 7 available to the developers

chris.bartz@ni.com chris.bartz at ni.com
Thu Jan 5 12:25:49 PST 2006


Okay, here are the gory details.  I can't take credit for inventing it;
Perforce tech support gave me most of the details and I'm pretty sure
others are doing very similar things.  To bootstrap the process you need
to create an offline database.  This is done by:
 
1) parse "p4 counters" output to get journal counter value.  The
checkpoint name will be checkpoint.<journal counter+1>.
2) "p4 admin checkpoint" (or "p4d -jc" if you prefer)
3) Optional.  Zip and backup the truncated journal file
4) Delete old offline database db.* files
5) Build offline database with "p4d -r <offlineDir> -jr <checkpoint>"
6) Zip and backup checkpoint
 
We do the above steps once a week so that we start each week with a fresh
offline database.  We currently keep all the journals between rebuilding
the offline database so we could recover from a real checkpoint plus
journal files if there was some problem with the offline database.
Rebuilding and keeping all the journals in between isn't really required
but when I set it up I wasn't 100% confident in the whole process.  If I
were making other changes to the process I would probably go with once a
month rebuilds and maybe not keep all the journals.
 
The offline checkpoint is done daily with:
 
1) parse "p4 counters" output to get journal counter
2) Truncate journal file with "p4d -r <root> -jj <journal filename>"  This
creates a files <journal filename>.jnl.<journal counter> and starts a new
journal file
3) Read truncated journal into offline database with "p4d -r <offline
root> -jr <journal filename>.jnl.<journal counter>"
4) Optional.  Zip and backup journal file
5) Checkpoint offline database with "p4d -r <offline root> -jd
<checkpoint>.<journal counter + 1>".  The journal file + 1 is so it has
the same name as perforce would give it if we checkpointed the live
database.
6) Optional.  Zip and backup checkpoint
7) Optional.  Delete old checkpoints and journals (we keep all journals
between rebuilding the offline database and 3 checkpoints).
 
When this is done we have a checkpoint and journal file that should be
exactly the same as if we did the "p4 admin checkpoint" on the live
database.  There is essentially zero downtime (except the weekly rebuild).
The offline database could be on another machine and the checkpoint could
be done there if disk space or processing power were an issue.
 
The depot files are backed up after this process is done.  We do not shut
perforce down for that backup.  You really don't need to; what perforce
does to handle this is simple and does work.
 
-Chris
 
 


  _____  

From: p4sync at yahoo.com [mailto:p4sync at yahoo.com] 
Sent: Tuesday, January 03, 2006 2:34 AM
To: Chris Bartz; perforce-user at perforce.com
Cc: p4sync at yahoo.com
Subject: RE: [p4] Need to make the P4 Sever 24 x 7 available to the
developers


Hi Chris 
 
I really want to know more about that, It would be great if you kindly let
me know more details about the 'offline checkpoints'. 
 
Currently we have this downtime details 
 
For Checkpoint = 120 min
For File Copy = 40 min

Thats why total we have almost 3 Hrs of downtime. 
 
If we can do something on checkpoint then we can afford to make file copy
time (of 40 min )



More information about the perforce-user mailing list