Jump to content


Duplicating Sync/Submit commands at remote sites to PreCache Proxies

Proxy Broker Sync Trigger

  • Please log in to reply
3 replies to this topic

#1 Gavin Will

Gavin Will

    Newbie

  • Members
  • Pip
  • 9 posts

Posted 06 June 2013 - 11:12 AM

Hi

For a very specific user I am wanting to "clone" their behavior at remote sites so that we have a certain data set precached at remote sites almost instantly.

Example. SepcificUser checks out a file and then submits it. On the submit we would want the remote sites to then do a p4 sync of the submitted file. Therefore making this file up to date and sitting in the remote proxies cache so that when users come along to do their work we know it will be available for them "instantly"

Same would apply if the SpecifiUser did a sync it would also then kick of a sync of the same files at the remote sites.

I was therefore thinking of a trigger or a broker to do this.

I don't want to use a trigger just now because if it was a trigger for submits and syncs we would waste resources for enumerating if this was the specific user where in most cases it wouldn't be. Unless I am wrong - Can you filter triggers on users? I thought it was on event and your script would then have to have the logic to filter out the users as required.

I thought that a broker may be suited and we create a rule for SpecificUser and Sync to  then execute a program which would then Sync to changelist or file.

Any Ideas or suggestions about the way to go about this? Is anyone doing anything similar?

Thanks

#2 P4Matt

P4Matt

    Advanced Member

  • Members
  • PipPipPip
  • 1383 posts

Posted 06 June 2013 - 05:49 PM

You are correct; triggers are on events and not filterable by user. The server will pass your user name to the trigger script which makes it fairly fast to check the user and bailout early if it isn't the right person.

There are triggers on submit but not sync. You would need a broker to catch that action and to act accordingly.

Given you want this near instant replication, have you considered using a forwarding replica instead of a proxy? Forwarding replicas automatically pull content into themselves.

#3 mjanulewicz

mjanulewicz

    Advanced Member

  • Members
  • PipPipPip
  • 311 posts
  • LocationSan Francisco, CA

Posted 06 June 2013 - 06:20 PM

+1 for the replica idea. Anything else seems like it has too many moving parts to break. You'll likely have to live with having more data than you want on the other end but it's probably a good price to pay for simplicity.

If you're absolutely bent on using a proxy instead of a replica, there are at least two ways you can get the files cached on the other end.

1. Run a frequent cron job to sync it using 'p4 sync -Zproxyload' to load files without actually syncing them, but use a workspace that's limited to the trees your user has access to.

2. Proxies are 'dumb' in that they don't have a database to track things, which also means they have no clue how files get put there. You could set up a live mirror/rsync type of thing to get specific files over there in near-realtime. There's a white paper/presentation from the last Perforce conference about that. :)

Just note that with a proxy, anyone can sync anything they want, so it could build up over time. If you're concerned about disk space, a replica is probably a better way to go. I think with the latest releases you can be more choosy about that.

I also have a hunch that in a couple years we may not have proxies any more, so it may be a good idea to get on board with replicas sooner rather than later.


--
Matt Janulewicz
Lucasfilm Entertainment Company Ltd.


________________________________________
From: perforce-user-bounces@perforce.com [perforce-user-bounces@perforce.com] on behalf of P4Matt [perforce-user-forum@forums.perforce.com]
Sent: Thursday, June 06, 2013 10:50 AM
To: perforce-user@perforce.com
Subject: Re: [p4] Duplicating Sync/Submit commands at remote sites to   PreCache Proxies

Posted on behalf of forum user 'P4Matt'.

You are correct; triggers are on events and not filterable by user. The server
will pass your user name to the trigger script which makes it fairly fast to
check the user and bailout early if it isn't the right person.

There are triggers on submit but not sync. You would need a broker to catch that
action and to act accordingly.

Given you want this near instant replication, have you considered using a
forwarding replica instead of a proxy? Forwarding replicas automatically pull
content into themselves.



--
Please click here to see the post in its original format:
  http://forums.perfor...recache-proxies
_______________________________________________
perforce-user mailing list  -  perforce-user@perforce.com
http://maillist.perf...o/perforce-user
_______________________________________________
perforce-user mailing list  -  perforce-user@perforce.com
http://maillist.perf...o/perforce-user

Matt Janulewicz
Lucasfilm Entertainment Company Ltd.

#4 Gavin Will

Gavin Will

    Newbie

  • Members
  • Pip
  • 9 posts

Posted 11 June 2013 - 12:40 PM

Hi Guys

Thanks for the input. I am aware of replicas but in this instance it isnt feasible.

I have found what I find to be the easiest was simply do a p4 sync @specificuserworkspacename on the remote proxy vi a scheduled job. This way the specific users changes are copied across very quickly.

Thanks





Also tagged with one or more of these keywords: Proxy, Broker, Sync, Trigger

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users