bug(server): do not write lsn opcode to journal (#2814)

Signed-off-by: adi_holden <adi@dragonflydb.io>
This commit is contained in:
adiholden 2024-04-02 09:51:42 +03:00 committed by GitHub
parent a93ad4e86f
commit bb242a7894
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 26 additions and 18 deletions

View file

@ -63,7 +63,8 @@ void JournalWriter::Write(std::monostate) {
void JournalWriter::Write(const journal::Entry& entry) {
// Check if entry has a new db index and we need to emit a SELECT entry.
if (entry.opcode != journal::Op::SELECT && (!cur_dbid_ || entry.dbid != *cur_dbid_)) {
if (entry.opcode != journal::Op::SELECT && entry.opcode != journal::Op::LSN &&
entry.opcode != journal::Op::PING && (!cur_dbid_ || entry.dbid != *cur_dbid_)) {
Write(journal::Entry{journal::Op::SELECT, entry.dbid, entry.slot});
cur_dbid_ = entry.dbid;
}