Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: allow rdb version 12 #3860

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/redis/rdb.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

/* The current RDB version. When the format changes in a way that is no longer
* backward compatible this number gets incremented. */
#define RDB_VERSION 11
#define RDB_VERSION 12

/* We would like to serialize to version 9 such that our rdb files
* can be loaded by redis version 6 (RDB_VERSION 9) */
Expand Down Expand Up @@ -110,6 +110,7 @@
/* Range 200-240 is used by Dragonfly specific opcodes */

/* Special RDB opcodes (saved/loaded with rdbSaveType/rdbLoadType). */
#define RDB_OPCODE_SLOT_INFO 244 /* Individual slot info, such as slot id and size (cluster mode only). */
#define RDB_OPCODE_FUNCTION 246 /* engine data */
#define RDB_OPCODE_FUNCTION2 245 /* function library data */
#define RDB_OPCODE_FUNCTION_PRE_GA 246 /* old function library data for 7.0 rc1 and rc2 */
Expand Down
11 changes: 11 additions & 0 deletions src/server/rdb_load.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2280,6 +2280,17 @@ error_code RdbLoader::Load(io::Source* src) {
continue;
}

if (type == RDB_OPCODE_SLOT_INFO) {
[[maybe_unused]] uint64_t slot_id;
SET_OR_RETURN(LoadLen(nullptr), slot_id);
[[maybe_unused]] uint64_t slot_size;
SET_OR_RETURN(LoadLen(nullptr), slot_size);
[[maybe_unused]] uint64_t expires_slot_size;
SET_OR_RETURN(LoadLen(nullptr), expires_slot_size);
LOG(WARNING) << "Loaded and ignored RDB_OPCODE_SLOT_INFO";
continue;
}

if (!rdbIsObjectTypeDF(type)) {
return RdbError(errc::invalid_rdb_type);
}
Expand Down
Loading