mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-11 02:15:45 +02:00
feat: Use journal LSNs for absolute replication offsets (#1242)
* feat: Use journal LSNs for absolute replication offsets * 1 - Address small CR comments 2 - Simplify the offset accounting so that we send the correct offset in `SliceSnapshot::Stop` instead of counting in RdbLoader. This allows us to revert the changes to slice journaling of EXEC commands, for example. * Store int with absl::little_endian * Document the offset management
This commit is contained in:
parent
6962771c21
commit
cbb2afc792
17 changed files with 90 additions and 43 deletions
|
@ -65,6 +65,8 @@ void JournalWriter::Write(const journal::Entry& entry) {
|
|||
cur_dbid_ = entry.dbid;
|
||||
}
|
||||
|
||||
VLOG(1) << "Writing entry " << entry.ToString();
|
||||
|
||||
Write(uint8_t(entry.opcode));
|
||||
|
||||
switch (entry.opcode) {
|
||||
|
@ -187,6 +189,8 @@ io::Result<journal::ParsedEntry> JournalReader::ReadEntry() {
|
|||
SET_OR_UNEXPECT(ReadUInt<uint64_t>(), entry.txid);
|
||||
SET_OR_UNEXPECT(ReadUInt<uint32_t>(), entry.shard_cnt);
|
||||
|
||||
VLOG(1) << "Read entry " << entry.ToString();
|
||||
|
||||
if (opcode == journal::Op::EXEC) {
|
||||
return entry;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue