I'll move it - that helps with the layering issue. I put it in the other location because it seemed more logical to set the flag after we have done a checkpoint. There will always be a cursor open until after the checkpoint has completed, so it's reasonable to set the flag there.

I thought about moving the call to __wt_btree_release_memsize into the checkpoint worker, but that's not ideal - we want eviction to be possible as soon as the chunk isn't the primary chunk any longer.