Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SERVER-21311 fixing crash on shutdown in RocksRecoveryUnit::dbRelease…
…Snapshot Problem description: The crash was caused by dangling pointer to RocksRecoveryUnit stored in the instance of RocksSnapshotManager::SnapshotHolder class. Crash scenario: - execute administrative 'makeSnapshot' command. This will create instance of RocksSnapshotManager::SnapshotHolder which is stored in RocksSnapshotManager's snapshots map. - SnapshotHolder has raw pointer to RocksRecoveryUnit instance which is destroyed at the end of 'makeSnapshot' command handler - destructor of SnapshotHolder is called on shutdown when snapshot maps are cleared in RocksSnapshotManager::dropAllSnapshots - destructor of SnapshotHolder tries to release snapshot using stored pointer to RocksRecoveryUnit instance which was destroyed earlier Fix description: Instead of storing RocksRecoveryUnit pointer in SnapshotHolder we will store pointer to rocksdb::DB instance. Thus we will be able to call rocks::DB::ReleaseSnapshot() from SnapshotHolder's destructor and SnapshotHolder will be independent of RocksRecoveryUnit lifetime.
- Loading branch information