mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-11 10:25:47 +02:00
feat(rdb_load): add support for loading huge lists (#3850)
* feat(rdb_load): add support for loading huge lists * feat(rdb_load): add EnsureObjEncoding
This commit is contained in:
parent
a01dfcb5b6
commit
a066579930
2 changed files with 99 additions and 56 deletions
|
@ -624,4 +624,24 @@ TEST_F(RdbTest, LoadHugeZSet) {
|
|||
ASSERT_EQ(100000, CheckedInt({"zcard", "test:1"}));
|
||||
}
|
||||
|
||||
// Tests loading a huge list, where the list is loaded in multiple partial
|
||||
// reads.
|
||||
TEST_F(RdbTest, LoadHugeList) {
|
||||
// Add 2 lists with 100k elements each (note must have more than 512*8Kb
|
||||
// elements to test partial reads).
|
||||
Run({"debug", "populate", "2", "test", "100", "rand", "type", "list", "elements", "100000"});
|
||||
ASSERT_EQ(100000, CheckedInt({"llen", "test:0"}));
|
||||
ASSERT_EQ(100000, CheckedInt({"llen", "test:1"}));
|
||||
|
||||
RespExpr resp = Run({"save", "df"});
|
||||
ASSERT_EQ(resp, "OK");
|
||||
|
||||
auto save_info = service_->server_family().GetLastSaveInfo();
|
||||
resp = Run({"dfly", "load", save_info.file_name});
|
||||
ASSERT_EQ(resp, "OK");
|
||||
|
||||
ASSERT_EQ(100000, CheckedInt({"llen", "test:0"}));
|
||||
ASSERT_EQ(100000, CheckedInt({"llen", "test:1"}));
|
||||
}
|
||||
|
||||
} // namespace dfly
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue