Came out of an investigation of false positive Coverity ticket. We currently make a copy of a snapshot of _metadata here and write this disk to value. After writing this value out, we update the real _metadata value for that key here, setting its dirty flag to false.
However, any writer can acquire the lock and write to the real _metadata while we are operating on the snapshot of metadata state. If a thread writing to a collection calls commit on the same collection that we are flushing writes for, after flushing the write we will set the dirty flag for this collection to false without having written the latest _metadata value for that collection to disk.