wiredtiger/wiredtiger — pull request #935 by keithbostic (2014-03-29 22:23:53+00:00)
Title: Move WT_PAGE.parent, WT_PAGE.ref_hint into WT_REF structure.

@michaelcahill: as I mentioned earlier, I think the right solution to the split problem we're seeing is to move the WT_PAGE.parent pointer into the WT_REF structure. That allows splits to complete without acquiring hazard pointers on the children, since the children aren't modified.

I took a run at this change to see how harsh it would be, and this branch is the result. It runs reasonably well (format and the test suite), but isn't yet stable. I'm happy to throw it away if you hate this approach, or to re-implement parts of it if you only want parts, or whatever.

The reason the change is so large is because once a WT_REF can identify the page in which it's located, big parts of the btree layer naturally switch from passing around, or operating on, WT_PAGEs, and instead pass around or operate on WT_REFs. For example, the eviction list is now an array of WT_REFs, the tree-walk code returns a WT_REF, the page get, release and discard functions all take WT_REFs.

In summary, this change:

* switches big parts of the btree layer from using WT_PAGE structures to using WT_REF structures,
* is slightly space negative (the WT_REF structure grows to 48B from 44B in develop, the WT_PAGE structure shrinks from 88B in develop to 72B),
* removes the need for split to acquire hazard references on child pages in order to fix up their parent pointers,
* removes the need for searching for a page's "current" WT_REF structure (except for a single place in the tree-walk code),
* is roughly code neutral, so far I've removed slightly more lines of code than I added.

As I said, I'm happy to throw this away if you don't like it -- once you've taken a look, let's talk.