wiredtiger/wiredtiger — pull request #252 by keithbostic (2012-06-29 15:40:10+00:00)
Title: Checkpoint has to flush the metadata file

Checkpoint has to flush the metadata file, but only after it's flushed all of the other files (in summary, we walk the set of files and checkpoint each of them, which updates WiredTiger.wt, then we checkpoint WiredTiger.wt, which updates WiredTiger.turtle, which is flushed to disk).

Michael, in short, we're not flushing the metadata file after checkpoint. I didn't track it back, but my guess is we lost the schema file flush somewhere along the line of doing all the checkpoint code shuffling.

This is my second try -- I originally changed the __wt_conn_btree_apply and __wt_meta_btree_apply functions to apply the specified function to the meta-data file, after applying it to all other files, but that gets mess in __wt_meta_btree_apply, and doesn't handle the case where the checkpoint has a target list of files. So, in this branch I've added a specific checkpoint of the metadata file in __wt_txn_checkpoint() itself immediately before the call to __wt_meta_track_off.

I've closed that pull request and deleted the branch from github.

I've tested this change with named and unnamed checkpoints of the complete database and a target list, and it seems to work.

I'm not all that confident on my btree handling locking (or lack thereof), so please check that closely. I think it's right, but I'm weak on my understanding of that stuff.