壊れやすいと噂には聞いていたけど、SubversionのBerkeley DBがはじめて壊れた。
Eclipseでupdate中にこんなエラーがでる。
update -r HEAD C:/develop/europa/initializeScript
Berkeley DB error
svn: PROPFIND request failed on '/svn/sandbox/initializeScript'
svn: Could not open the requested SVN filesystemBerkeley DB 壊れる。 そして直る!を参考に直した。
svnadmin recover (REPODIR)
rm -f (REPODIR)/db/log.*
chown -R (REPOOWNER):(REPOOWNER) (REPODIR)(REPODIR)と(REPOOWNER)は適当に読み替えてください。
・・・やっぱ、fsfsにした方が無難ですかね。
以下具体的な手順。
まずはverify
$ svnadmin verify /work/svnroot/sandbox
svnadmin: ファイルシステム '/work/svnroot/sandbox/db' に対して環境を開いているときに Berkeley DB エラーが起きました
svnadmin: DB_RUNRECOVERY: Fatal error, run database recovery
svnadmin: bdb: PANIC: fatal region error detected; run recoveryやっぱだめ。 次はリカバー
$ svnadmin recover sandbox
リポジトリのロックを取得しました。
お待ちください。リポジトリの復旧にはいくらか時間がかかります...
復旧が終わりました。
リポジトリの最新のリビジョンは 166 です。復旧できたと思いきや、eclipse上で同じエラーが起きる。 手順に従い、ログを消してみる。
$ ll
合計 31280
-rw-r--r-- 1 apache apache 1955 10月 27 2006 DB_CONFIG
-rw-r--r-- 1 root apache 16384 8月 1 19:33 __db.001
-rw-r--r-- 1 root apache 278528 8月 1 19:33 __db.002
-rw-r--r-- 1 root apache 393216 8月 1 19:33 __db.003
-rw-r--r-- 1 root apache 1327104 8月 1 19:33 __db.004
-rw-r--r-- 1 root apache 16384 8月 1 19:33 __db.005
-rw-r--r-- 1 apache apache 135168 8月 1 19:34 changes
-rw-r--r-- 1 apache apache 8192 8月 1 19:34 copies
-r--r--r-- 1 apache apache 2 7月 21 19:10 format
-rw-r--r-- 1 apache apache 4 10月 27 2006 fs-type
-rw-r--r-- 1 apache apache 8192 8月 1 19:34 lock-tokens
-rw-r--r-- 1 apache apache 8192 8月 1 19:34 locks
-rw-r--r-- 1 apache apache 1048516 8月 1 10:20 log.0000000166
-rw-r--r-- 1 apache apache 1048560 8月 1 10:21 log.0000000167
-rw-r--r-- 1 apache apache 814994 8月 1 19:34 log.0000000168
-rw-r--r-- 1 apache apache 151552 8月 1 19:34 nodes
-rw-r--r-- 1 apache apache 151552 8月 1 19:34 representations
-rw-r--r-- 1 apache apache 8192 8月 1 19:34 revisions
-rw-r--r-- 1 apache apache 27246592 8月 1 19:34 strings
-rw-r--r-- 1 apache apache 49152 8月 1 19:34 transactions
-rw-r--r-- 1 apache apache 8192 8月 1 19:34 uuids
$ rm log.*
$ ll
合計 28424
-rw-r--r-- 1 apache apache 1955 10月 27 2006 DB_CONFIG
-rw-r--r-- 1 root apache 16384 8月 1 19:33 __db.001
-rw-r--r-- 1 root apache 278528 8月 1 19:33 __db.002
-rw-r--r-- 1 root apache 393216 8月 1 19:33 __db.003
-rw-r--r-- 1 root apache 1327104 8月 1 19:33 __db.004
-rw-r--r-- 1 root apache 16384 8月 1 19:33 __db.005
-rw-r--r-- 1 apache apache 135168 8月 1 19:34 changes
-rw-r--r-- 1 apache apache 8192 8月 1 19:34 copies
-r--r--r-- 1 apache apache 2 7月 21 19:10 format
-rw-r--r-- 1 apache apache 4 10月 27 2006 fs-type
-rw-r--r-- 1 apache apache 8192 8月 1 19:34 lock-tokens
-rw-r--r-- 1 apache apache 8192 8月 1 19:34 locks
-rw-r--r-- 1 apache apache 151552 8月 1 19:34 nodes
-rw-r--r-- 1 apache apache 151552 8月 1 19:34 representations
-rw-r--r-- 1 apache apache 8192 8月 1 19:34 revisions
-rw-r--r-- 1 apache apache 27246592 8月 1 19:34 strings
-rw-r--r-- 1 apache apache 49152 8月 1 19:34 transactions
-rw-r--r-- 1 apache apache 8192 8月 1 19:34 uuidsこれでも直らない。 で、よくよく見ると
-rw-r--r-- 1 root apache 16384 8月 1 19:33 __db.005所有者がrootになってる・・・orz
$ chown -R apache:apache sandbox
$ ll sandbox/db
合計 28432
-rw-r--r-- 1 apache apache 1955 10月 27 2006 DB_CONFIG
-rw-r--r-- 1 apache apache 16384 8月 1 19:35 __db.001
-rw-r--r-- 1 apache apache 278528 8月 1 19:35 __db.002
-rw-r--r-- 1 apache apache 393216 8月 1 19:35 __db.003
-rw-r--r-- 1 apache apache 1327104 8月 1 19:35 __db.004
-rw-r--r-- 1 apache apache 16384 8月 1 19:35 __db.005
-rw-r--r-- 1 apache apache 135168 8月 1 19:34 changes
-rw-r--r-- 1 apache apache 8192 8月 1 19:36 copies
-r--r--r-- 1 apache apache 2 7月 21 19:10 format
-rw-r--r-- 1 apache apache 4 10月 27 2006 fs-type
-rw-r--r-- 1 apache apache 8192 8月 1 19:36 lock-tokens
-rw-r--r-- 1 apache apache 8192 8月 1 19:36 locks
-rw-r--r-- 1 apache apache 4272 8月 1 19:36 log.0000000001
-rw-r--r-- 1 apache apache 151552 8月 1 19:34 nodes
-rw-r--r-- 1 apache apache 151552 8月 1 19:34 representations
-rw-r--r-- 1 apache apache 8192 8月 1 19:36 revisions
-rw-r--r-- 1 apache apache 27246592 8月 1 19:34 strings
-rw-r--r-- 1 apache apache 49152 8月 1 19:34 transactions
-rw-r--r-- 1 apache apache 8192 8月 1 19:36 uuidsこれで直った。
update -r 166 C:/develop/europa/initializeScript
At revision 166.よしよしupdateできた。 けど、リビジョン167, 168はどこかに消えた(涙
