cvt_cyrusdb and berkeley log files

Andreas andreas at conectiva.com.br
Tue Mar 2 08:50:30 EST 2004


While playing with the cvt_cyrusdb utility (and Simon's excellent
cvt_cyrusdb_all script) I came across this problem when converting
a database *from* berkeley *to* skiplist.

Let's say I have /var/lib/imap/mailboxes.db in berkeley format. I also
have berkeley transaction log files in /var/lib/imap/log.* and
/var/lib/imap/db/log.*.

I then shut down the cyrus daemon and convert mailboxes.db to skiplist.
The conversion succeeds:
# file mailboxes.db
mailboxes.db: Cyrus skiplist DB

Now I restart cyrus. And get this in the logs:
ctl_cyrusdb[30046]: DBERROR db4: /var/lib/imap/mailboxes.db: unexpected file type or format
ctl_cyrusdb[30046]: DBERROR db4: Recovery function for LSN 1 4471396 failed
ctl_cyrusdb[30046]: DBERROR db4: PANIC: Invalid argument
ctl_cyrusdb[30046]: DBERROR: critical database situation

It seems ctl_cyrusdb is attempting to read mailboxes.db as a DB file and not skiplist.
I *suppose* this happens because it is trying to recover the database using the log file
which was left there and contains BDB transactions. AFAIK, however, this type of recovery
procedure is called "catastrophic" by the berkeley folks: a normal recovery procedure
would only touch log files which contain uncommited transactions. Looking at the code, I
see that it is not performing catastrophic recovery (it's just using the DB_RECOVER flag
when opening the environment), so I'm at a loss here.

The only way to remedy this situation is to remove the relevant log files.
Anybody care to comment?

Thanks.

---
Home Page: http://asg.web.cmu.edu/cyrus
Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html




More information about the Info-cyrus mailing list