Fix a bug where flash CF options are being reset to default after flushall. (#718)

Co-authored-by: Karthick Ariyaratnam (A) <k00809413@china.huawei.com>
Co-authored-by: Malavan Sotheeswaran <105669860+msotheeswaran-sc@users.noreply.github.com>
This commit is contained in:
Karthick Ariyaratnam 2023-09-28 21:00:28 -04:00 committed by GitHub
parent 38169682f0
commit 57f4a2e8b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -144,12 +144,13 @@ void RocksDBStorageProvider::retrieve(const char *key, size_t cchKey, callbackSi
size_t RocksDBStorageProvider::clear()
{
size_t celem = count();
auto options = m_spdb->GetOptions(m_spcolfamily.get());
auto status = m_spdb->DropColumnFamily(m_spcolfamily.get());
auto strName = m_spcolfamily->GetName();
rocksdb::ColumnFamilyHandle *handle = nullptr;
rocksdb::ColumnFamilyOptions cf_options(m_pfactory->RocksDbOptions());
cf_options.level_compaction_dynamic_level_bytes = true;
rocksdb::ColumnFamilyOptions cf_options(options);
m_spdb->CreateColumnFamily(cf_options, strName, &handle);
m_spcolfamily = std::shared_ptr<rocksdb::ColumnFamilyHandle>(handle);