tags:

views:

16

answers:

1

Hi

I've set up mirroring of my repository and it works nicely but I've had an issue recently.

The target repository was left with an unreleased lock somehow - from what I read this may be caused by an abort to the svnsync operation and I suspect it may be because in my post-commit hook I'm executing svnsync in blocking mode rather then pushing it into the background via &.

I do this so that the user can be sure that if the commit finished then it's in all repositories now but maybe it introduces a risk of them hitting cancel and stopping the commit hook?

I can't find clear guidelines or suggestions on which is better or what the best practice is or even if hitting cancel can cause an abort of the post commit hook and the sync executed from it - in most places I see people using & to kick of the sync in the background - does this prevent the lock corruption in case a user presses cancel to his commit while the sync is in progress? How do you make sure both repositories are really in sync or report issues? Do you need a separate notification mechanism for that?

Update:

From the two above options I decided to chose the third ;)

I'm calling svnsync in the background but at the same time I make the hook wait for it to finish:

svnsync ... &
wait $!

I think this nicely joins the best of both worlds but time will show how effective it'll be - please let me know what you think about the whole issue and what suggestions you might have to share about it.

A: 

The post commit hook as the name implies runs after the complete commit and new revision in the source repository has been created. So the questions is: Who should how press the "abort" button? On the other hand why do you do a blocking operation? I would synchronize e.g. every 15 Minutes etc. independant of the commit...If you really new the other way what about Write-Through-Proxy ? The most important questions is why do you need a such synchronization with every commit?

khmarbaise
@khmarbaise: When you work with tortoise, the commit operation seems to be waiting until the post-commit hook completes and presents the output if it failed - even though the commit itself to the main repository is already done while the hook executes - when you press cancel then I think is when the sync might be getting aborted.As to why do a blocking operation - I need to make sure both repositories are always in sync as both are used in production by MANY clients and 15 minutes of out of sync would break the system I'm building (it has to be a transparent mirror not an out of date mirror).
RnR
As far as i know you can stop an execution which started on the server. On the other hand, why do you have two replicated repository and not using a single one? (May be think about Wandisco for replication in real time?)
khmarbaise
As usual - it's complicated :) I use SVN as a backend for serving data to a lot of machines - the data has to be versioned, branched etc. There are sites located in US and Europe and the repository is ~70GB in size right now so having a mirror on the other side really helps with the traffic ;)Wandisco would also probably work nice but it's not realy needed as commiting to a single repository is not an issue and just having reads local is enought for now.
RnR