[p4] Is Sync -f trouble?

Weintraub, David david.weintraub at bofasecurities.com
Wed Nov 1 06:18:22 PST 2006

Not doing a "sync -f" for a build is a tough piece of advice. Yes, "p4
sync" should work 99.9% of the time without any problems, but we're
always worried about that last 1/10%?

Still, why do you do both a "p4 sync #head" and then a "p4 sync -f"? If
you don't trust your build area, why not simply delete it which would be
a lot quicker than doing "p4 sync" twice?

Something like this:

    mv $BUILD_DIR $BUILD_DIR.old
    rm -rf $BUILD_DIR.old&
    mkdir $BUILD_DIR
    cd $BUILD_DIR
    p4 sync -f

That way, you're only running through "p4 sync" once. Another question
is whether you have to do a "p4 sync" of everything. Do you check in
binaries that you've built? Do you sync those when you do your "p4
sync"? If so, that can cause a lot of the slowness. Sync'ing a few 10meg
files over the network can take quite a bit of time. Maybe you can
change your client, or skip syncing binary directories if that's what
you're doing.

You also say you're doing "10 builds at a time". Why? Is this 10
different people doing a build? Are you building the same 10 products
with 10 different labels? Are you sync'ing the whole archive for each of
these 10 builds? Are these all "official" builds?

I agree that you should take timings of each of the steps you're doing,
and see what takes so much time. I suspect that your network may be
getting bogged down with multiple machines sync'ing at the same time.
The build itself doesn't involve any network traffic or updates from the
Perforce server. Labeling is almost strictly a server operation and
involves extremely little network traffic (just outputting the label
results to your system). Plus, I suspect that the database isn't
normally locked down during a label operation (adding records to a
database shouldn't lock the database).

The only operation that takes more network and server power than a sync
is a "p4 submit" which really locks down the database. I don't even know
if you can do a "p4 sync" while a "p4 submit" is taking place. The
Perforce server and your network could get really bogged down if you are
submitting hundreds of megabytes of build results into your server --
especially if you are doing 10 builds at once.

-----Original Message-----
From: perforce-user-bounces at perforce.com
[mailto:perforce-user-bounces at perforce.com] On Behalf Of Venters, Cheryl
Sent: Tuesday, October 31, 2006 11:49 PM
To: perforce-user at perforce.com
Subject: [p4] Is Sync -f trouble?

We're still having terrible problems with P4 performance. When I talked
to Perforce today, the person I talked to told me we should never be
running p4 sync -f. All of our automated scripts run the sequence sync
#none, delete the build directory, sync -f. That has been our policy for
a clean build. Does anybody have input on this? And, are there p4
commands that have a greater potential for hanging the server? 





perforce-user mailing list  -  perforce-user at perforce.com

More information about the perforce-user mailing list