Implement write rollbacks for multi-collection functions
The current model is to write a Run
document which links to several related documents (samples, annotations, references, and the raw file). The process of writing to all of them can fail midway and in such cases, it's desirable to have the existing updates undone. Unfortunately Mongo does not support transactions, so this has to be implemented on the client side.