Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

db_bench: Missing cleanup of db_ member in DBWithColumnFamilies::DeleteDBs() #374

Closed
udi-speedb opened this issue Jan 26, 2023 · 1 comment
Assignees
Labels
bug Something isn't working good first issue Good for newcomers up-for-grabs Upstreamable can be upstreamed to RocksDB

Comments

@udi-speedb
Copy link
Contributor

When FLAGS_optimistic_transaction_db is true (Non-ROCKSDB_LITE), the following method sets opt_txn_db to nullptr, but fails to also set db_ to nullptr. db_ should be set to nullptr in all paths.

  void DeleteDBs() {
    std::for_each(cfh.begin(), cfh.end(),
                  [](ColumnFamilyHandle* cfhi) { delete cfhi; });
    cfh.clear();
#ifndef ROCKSDB_LITE
    if (opt_txn_db) {
      delete opt_txn_db;
      opt_txn_db = nullptr;
    } else {
      delete db;
      db = nullptr;
    }
#else
    delete db;
    db = nullptr;
#endif  // ROCKSDB_LITE
  }
@udi-speedb udi-speedb added bug Something isn't working good first issue Good for newcomers Upstreamable can be upstreamed to RocksDB up-for-grabs labels Jan 26, 2023
@udi-speedb udi-speedb self-assigned this Jan 2, 2024
@udi-speedb
Copy link
Contributor Author

Looking at the code now I don't really see a scenario to actually cause any bugs. Will be reopened if any issue is found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers up-for-grabs Upstreamable can be upstreamed to RocksDB
Projects
Status: 📖 Need your Opinion!
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant