> I came across a crash in eviction while poking at LSM today. The btree->root_page pointer was NULL. Looking a bit further, the WT_BTREE_EXCLUSIVE flag was set on the btree handle.
> Should a btree handle be eligible for eviction when the exclusive flag is set?
Probably not. Certainly not if the root is NULL.
That seems reasonable, but I don't think it's sufficient. We're not holding any lock in eviction at that point that would stop the tree from switching to exclusive during the walk.
For example, an application thread could create an empty tree, eviction could start walking that tree, then the application thread could start a bulk load. The pages from the empty tree would be free from under eviction.