wiredtiger/wiredtiger — pull request #285 by keithbostic (2012-08-03 15:51:22+00:00)
Title: Change to identify read-only objects.

Add an "was object ever modified" flag to the btree handle, and use it to avoid writing read-only objects during internal checkpoints, issue #272.

Michael, the problem in #272 was I was talking about writing the data file itself and didn't realize you were talking about writing the schema file (and, because the schema file was written, the turtle file).

What's happening here is we're creating dirty files because that's what we want to reconcile, and we're checkpointing empty files because they're dirty. This is a little tricky, because we have to checkpoint these files if the checkpoint is named, it's only if it's a close or an internal checkpoint that we don't have to do any work.

This is actually a performance change, because it allows us to ignore read-only objects during internal checkpoints, that is, unless there's a reason to checkpoint an unmodified object, we can skip walking it just to figure out that there aren't any dirty pages.

Here's a fix for your review. I'll add a few comments into the diff to flag the interesting parts.