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:
Roy Jacobson 2023-05-22 15:34:32 +03:00 committed by GitHub
parent 6962771c21
commit cbb2afc792
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 90 additions and 43 deletions

View file

@ -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;
}