boltdb/bolt — pull request #228 by benbjohnson (2014-07-23 21:13:58+00:00)
Title: Fix root split on very large append.

This commit fixes a bug where a root split on a very large insert would cause an overflow of the root node. The problem was that the new root was not split when it was created so a new root with more than 64K child nodes would overflow the `page.count` (uint16).

This problem would occur when appending ~200,000 500 byte key/value pairs into a single bucket in a single transaction. This issue was previously prevented because the freelist overflow error and the double spill would rollback this kind of transaction.

See line notes for more info.

/cc @mkobetic @snormore