You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are leveraging RocksDB and are leveraging the transaction mechanism to sync with other structures. We encountered a behavior where there would be thousands of LOG files in the main directory of the database.
By trying to reproduce on a small scale, we discovered that empty transactions seems to be the cause of this. Our system do frequent commits and it happens that no operations were done in part of the systems, but other parts are required to commit.
We tried playing with WAL_ttl_seconds but were not able to reproduce the behavior. If we add a simple Put to the database, then the LOG files are properly deleted once they are no longer required.
Expected behavior
LOG files should be cleaned-up once they are no longer required.
Actual behavior
LOG files accumulate when empty transactions are committed.
Steps to reproduce the behavior
rocksdb::TransactionDB* txnDb{nullptr};
rocksdb::TransactionDBOptions txnDbOpts;
rocksdb::Options options;
options.create_if_missing = true;
txnDbOpts.write_policy = rocksdb::TxnDBWritePolicy::WRITE_PREPARED;
for (int i = 0; i < 10; ++i) {
auto status = rocksdb::TransactionDB::Open(options, txnDbOpts, "/tmp/rdbtest", &txnDb);
assert(status.ok());
rocksdb::WriteOptions wrtOpts{};
rocksdb::TransactionOptions txnOpts{};
trn->Prepare();
trn->Commit();
delete trn;
rocksdb::FlushOptions fopt;
fopt.wait = true;
status = txnDb->Flush(fopt);
assert(status.ok());
rocksdb::CancelAllBackgroundWork(txnDb, true);
status = txnDb->Close();
assert(status.ok());
delete txnDb;
}
The text was updated successfully, but these errors were encountered:
We are leveraging RocksDB and are leveraging the transaction mechanism to sync with other structures. We encountered a behavior where there would be thousands of LOG files in the main directory of the database.
By trying to reproduce on a small scale, we discovered that empty transactions seems to be the cause of this. Our system do frequent commits and it happens that no operations were done in part of the systems, but other parts are required to commit.
We tried playing with WAL_ttl_seconds but were not able to reproduce the behavior. If we add a simple Put to the database, then the LOG files are properly deleted once they are no longer required.
Expected behavior
LOG files should be cleaned-up once they are no longer required.
Actual behavior
LOG files accumulate when empty transactions are committed.
Steps to reproduce the behavior
The text was updated successfully, but these errors were encountered: