Files
jormun-db/rocksdb_shim/rocksdb_shim.cc
2026-02-15 11:17:12 -05:00

22 lines
731 B
C++
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// TODO: In order to use RocksDB's WAL replication helpers, we need to import the C++ library so we use this shim
/**
C++ shim implementation notes (the important bits)
In this rocksdb_shim.cc we'll need to use:
rocksdb::DB::Open(...)
db->GetLatestSequenceNumber()
db->GetUpdatesSince(seq, &iter)
from each TransactionLogIterator entry:
get WriteBatch and serialize via WriteBatch::Data()
apply via rocksdb::WriteBatch wb(data); db->Write(write_options, &wb);
Also we must configure WAL retention so the followers dont fall off the end. RocksDB warns the iterator can become invalid if WAL is cleared aggressively; typical controls are WAL TTL / size limit.
https://github.com/facebook/rocksdb/issues/1565
*/