wiredtiger/wiredtiger — pull request #207 by michaelcahill (2012-05-04 09:51:46+00:00)
Title: Handle locking

Hi Keith,

Here is a set of changes that deserve some critical review. They fix a bunch of problems, specifically:

* they make it possible to close handles that other sessions have cached, which has been a long-term issue;
* verify no longer does an ordinary open of the file after it completes, so it shouldn't be truncated (I haven't checked; and
* they get rid of btree handles from the schema layer, which is one step closer to splitting btree handles into low-level and high-level pieces, and also gets the schema layer closer to being able to work with other data sources underneath (e.g., LSM trees).

That said, there is still some fragile code. Specifically, closing handles before dropping them is painful because we have to lock all of the open snapshot handless in order to close a tree before dropping it, but then the drop code itself needs locks to guarantee exclusive access. And of course if something goes wrong in the middle, we have to clean it all up.

So, your suggestions for further cleanup and/or simplification are much appreciated. Thanks!

Michael.