[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [Subversion Wiki] Update of "CopySvnsyncMirrorToMaster" by PhilipMartin

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Thu, 03 Nov 2011 13:10:32 +0200

On Thursday, November 03, 2011 10:29 AM, "Apache Wiki" <wikidiffs_at_apache.org> wrote:
> Dear Wiki user,
>
> You have subscribed to a wiki page or wiki category on "Subversion Wiki" for change notification.
>
> The "CopySvnsyncMirrorToMaster" page has been changed by PhilipMartin:
> http://wiki.apache.org/subversion/CopySvnsyncMirrorToMaster?action=diff&rev1=7&rev2=8
>
>
> The master repository has corruption in some of its revision files, but the mirror repository does not. ([[http://subversion.tigris.org/issues/show_bug.cgi?id=3845|Issue 3845]]).
>
> - Master and slave are still live since commits that don't access the corrupt data still work.
> + Master and slave are still live since commits that don't access the corrupt data still work. We want to copy the slave to the master with minimal downtime.
>

Thanks for making this requirement explicit.

> == The Repair ==
> - Ensure the master repository is off line and the other preconditions are met. Keep a backup of the master repository before starting to fix it.
> + 1. Create a new repository that will become the new master.
> + 2. Use 'svnsync init' to setup the slave as the temporary source for the new master.
> + 3. At this point 'svnsync synchronize' can be used to bring the new master up-to-date, but rsync is probably faster.
> + * rsync 'db/current'
> + * rsync 'db' excluding 'db/current', db/locks', 'db/transactions', 'db/txn-protorevs', 'db/revprops' and 'db/rep-cache.db'
> + * make slave read-only
> + * rsync 'db/rep-cache.db'
> + * make slave read-write
> + 4. Adjust svn:sync-last-merged-rev to the youngest revision in the new master and run 'svnsync sync'.

You'd need to mkdir revprops/$youngest_shard/ for the sync to work.

> + 5. Disable revprop changes on the master, or make the master read-only.
> + 6. Copy 'db/revprops' from the master into the new master.
> + 7. Make the master read-only if not already.

Suggestion: document at the top of the file that this procedure is for Subversion 1.7 and earlier. They may or may not continue to work as we bump FS formats.

> + 8. Ensure slave is up-to-date and run 'svnsync sync' to get any final commits.

You deleted the svn:sync-* revprops in step 6.

> + 9. Delete svn:sync-* revprops from new master r0.
> + 10. Take master offline.
> + 11. Replace master 'db' with 'db' from new master.
> + 12. Check whether 'db/fsfs.conf' needs to be adjusted.
> + 13. Bring master back online.
>
> - Copy, by any convenient method (such as rsync or by physically shipping a disk), the following parts of the mirror repository into the master repository:
> -
> - * the 'db' subdirectory
> - * optionally omit 'db/locks', 'db/transactions', 'db/txn-protorevs' as they're not needed
> - * optionally omit 'db/revprops' if you want to keep the master's revprops
> -
> - Then delete 'db/locks/*', 'db/transactions/*' and 'db/txn-protorevs/*'.
> -
> - Check whether the settings in 'db/fsfs.conf' need to be adjusted or merged with the previous (backed up) version of this file.
> -
>
Received on 2011-11-03 12:11:04 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.