Transactions are executed until there is either a rollback or a commit. On rollback, the operations from the transaction are reversed.

The RocksDB storage engine applies operations of a transaction in main memory only until they are committed. In case of an a rollback the entire transaction is just cleared, no extra rollback steps are required.

In the event of a server crash, the storage engine scans the write-ahead log to restore certain meta-data like the number of documents in collection or the selectivity estimates of secondary indexes.