[p4] Is there a way to write-lock the database while my backup runs?
jgrills at drivensnow.org
Tue Feb 21 10:16:19 PST 2006
I'd be surprised if perforce would be usable with the DB locked. Any "p4
sync", which seems like a read-only operation as far as the depot files go,
has to write to the DB to update the list of files it knows are on your
client. Perforce clients also have an "access" field as well that will get
updated whenever the client is used, which will also cause a write to the
But still, I could still see the use for a "p4 admin lock" which would wait
until perforce was idle, lock the DB, and return. We'd also need an unlock.
If you backed up the DB in this state, though, I'd assume that it would
restore in a locked state, and it would have to be unlocked before anyone
else could use it. It would also be nice if supers could use perforce while
it was in the locked state. When I'm testing perforce upgrades and such, I
often have to wipe out my protection table (leaving just super access) to
prevent users from trying to use perforce before I'm ready for them - the
locked state would solve that too.
From: perforce-user-bounces at perforce.com
[mailto:perforce-user-bounces at perforce.com] On Behalf Of Craig A
Sent: Tuesday, February 21, 2006 9:07 AM
To: perforce-user at perforce.com
Subject: [p4] Is there a way to write-lock the database while my backup
It seems like this ought to be a common question, but I searched the mail
archives and did not find anything.
We have a nightly script running which:
a) stops the service.
b) truncates the journal, moves journal file to backup location
c) copies the depot files to a backup location
d) restarts the service
We do it this way to ensure we have a consistent backup set, as described in
If there was a way to 'lock' the depot for updates, we could replace a) and
d) with the database lock, and still have perfectly consistent backups. This
would allow us to reduce our downtime from about 30 minutes down to the few
seconds for the journal truncate. Of course writes to the database would be
held up, but the vast majority of our activity is 'read'.
Is this feature available or does anyone know if it is in the enhancement
perforce-user mailing list - perforce-user at perforce.com
More information about the perforce-user