facebook / facebook/rocksdb

How TransactionDB replicates?

Open
#10,285 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
32.1k
Forks
6.9k
Avg merge
32m
Merged PRs (30d)
1

Description

> Note: Please use Issues only for bug reports. For questions, discussions, feature requests, etc. post to dev group: https://groups.google.com/forum/#!forum/rocksdb or https://www.facebook.com/groups/rocksdb.dev

### Expected behavior
rocksdb::WriteBatch write_batch(iter->GetBatch().writeBatchPtr->Data());
status = db->Write(rocksdb::WriteOptions(), &write_batch);

Write operation succeeded.

### Actual behavior
Invalid argument: MarkNoop() handler not defined.

### Steps to reproduce the behavior
`int main()
{
std::string db_dir = "./transaction_db_test/";
rocksdb::Options options;
rocksdb::TransactionDBOptions toptions;

options.OptimizeForSmallDb();
options.create_if_missing = true;

rocksdb::TransactionDB *db = nullptr;
auto status = rocksdb::TransactionDB::Open(options, toptions, db_dir, &db);

if (!status.ok())
{
std::cout << "Open failed " << status.ToString() << std::endl;
return 0;
}

db->Put(rocksdb::WriteOptions(), "abc", "123");

std::unique_ptr iter;
status = db->GetUpdatesSince(0, &iter, rocksdb::TransactionLogIterator::ReadOptions());

if (!status.ok())
{
std::cout << "GetUpdatesSince failed " << status.ToString() << std::endl;
return 0;
}

for (; iter->Valid(); iter->Next())
{
rocksdb::WriteBatch write_batch(iter->GetBatch().writeBatchPtr->Data());

status = db->Write(rocksdb::WriteOptions(), &write_batch);

if (!status.ok())
{
std::cout << "Write failed " << status.ToString() << std::endl;
return 0;
}
}

return 0;
}`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.