I'm a little unclear on the purpose of the metadata lock, here's where it's used:
+ *wt_compact wraps calls to *wt_bt_cache_op() in the metadata lock, the comments indicate it's to avoid page reconciliation collisions with checkpoints (and I'm guessing, handle close, since that code calls the checkpoint worker code),
+ __wt_conn_btree_sybnc_and_close acquires it for bulk-load handles, the comments indicate it's to avoid racing with checkpoints,
+ *wt_lsm_meta_write wraps a call to *wt_metadata_update() inside metadata lock (which looks wrong to me – I thought updating the schema file required the schema lock!?)
+ __wt_txn_checkpoint acquires it, of course
I'm wondering if we should rename the metadata lock to be the "checkpoint lock", and the use in __wt_lsm_meta_write() is wrong?