Summary:
Sometimes auto-compactions could be enabled on RocksDB instance concurrently with another thread is deleting intent SST files.
This translates to concurrent RocksDB instance options change and accessing those options from `VersionSet::LogAndApply`.
For performance reasons `VersionSet::LogAndApply` is calling `Version::PrepareApply` outside of DB mutex and this reads RocksDB options causing data race.
Added `DeleteFileTest.DeleteWithConcurrentOptionsChange` for reproducing this issue reliably in RocksDB itself. Then found that original RocksDB also had this issue and ported the fix from: https://github.com/facebook/rocksdb/pull/3691
Jira: DB-13133
Test Plan:
`ybd tsan --sj --gtest_filter DeleteFileTest.DeleteWithConcurrentOptionsChange -n 10 -- -p 1`
`ybd tsan --sj --gtest_filter PgCatalogVersionTest.SimulateUpgradeToPerdbMode -n 20 -- -p 1`
Reviewers: arybochkin
Reviewed By: arybochkin
Subscribers: ybase
Tags: #jenkins-ready
Differential Revision: https://phorge.dev.yugabyte.com/D39614