|Fix broken Subversion repository|
|Written by Павел Алексеев aka Pahan-Hubbitus|
|Friday, 15 April 2011 10:54|
All known what backups is absolutely required. There nothing to discuss.
And they was present. But by some mistake my SVN repositories does not hit it...
As you already could understand I speak about recovery crashed (corrupted) subversion repository. Standard "svnadmin verify" detect problem, but "svnadmin recovery" wasn't able recovery anything. It is very bad situation. I start search solution. Reading many articles across internet do not gave me solution. In most I see attempt recreate full repository structure. In my case I had kilobytes of zeros in revs files and understand it is not my case. Leaved single solution - recover repository with already saved data. In several repos it wasn't so hard - corrupted revisions just may be skiped and recovery procedure simple:
On the end of process got repository with less revisions, but fully functional. When also present working copy, then it commited and nothing changes lost at all. Off course fresh recheckout needed because revision numbers changed.
All seams good while I work with not so seriously corrupted repository. But I have one with many errors too. It contains about 600 commits with many random placed corrupted revisions. But it is not main problem there too. Until now I do all work manually - save numerated dumps - then restore it. The main problem happened when I can't load one of the dump! Even if all dumped correctly is not guarantie what all will be loaded because there may be references to missed revisions! What is in addition is very annoying - "svndump load" do not work atomically and does not guaranty consistence of repository if error occurred! It I understand on practice. Further loading dumps may lead unpredictable behavior. Single found solution in that situation - start loading from beginning (0 dump) and recreate repository. In that situation off course problematic dump piece must be redumped without problematic revision (if it was not boundary revision, then dump splits to two parts also).
On that phase I spent several hours to investigations and tries and make decision start scripting to make chance finish it work at all. Looking ahead I should say that it is not in vain, because the total run on the repository was in automatic mode, more than 12 hours in average...
As script was introduced there also was implemented saving original revision enumeration. Just missed in dumps revisions replaced by stub with property set (with text explanation what is it). Mostly for the leave legitimacy outer reference on its numbers in tracker, but also to do not force recheckout of working copy. Off course as it automated script there also was added several integrity checks and other useful stuff.
I should say again - do backups. Always. But if you were still in such a situation - feel free try this scripts. If you have some questions - also do not hesitate contact me.
At end some words about script itself:
Последнее из блога
- mts продай местных провайдеров обратно
- Наконец-то httpd-itk в Федорке
- Unisender - простой скрипт для отправки SMS
- Fix broken Subversion repository
- Hh.ru - правим задумку иродов
- Работные сайты, почему у нас все так плохо?
- Begun-hypercontext in joomla extensions directory
- Joomla begun hypertext plugin