mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-11 02:15:45 +02:00
chore(rdb): move object creation during loading to shard threads. (#188)
Related to #159. Before this change, rdb loading thread has been creating all the redis objects as well. Now we separate rdb file parsing and objects creation. File parsing phase produces a load trace of one or more binary blobs. Those blobs are then passed to the threads that are responsible to manage the objects. The second phase is object creation based on the trace that was passed. Finally those binary blobs are destroyed. As a result, each thread creates objects using the memory allocator it owns and memory stats become consistent. Signed-off-by: Roman Gershman <roman@dragonflydb.io>
This commit is contained in:
parent
8cb486a690
commit
55389d9be5
6 changed files with 760 additions and 395 deletions
|
@ -97,6 +97,9 @@ TEST_F(RdbTest, LoadSmall6) {
|
|||
EXPECT_THAT(StrArray(resp.GetVec()[1]),
|
||||
UnorderedElementsAre("list1", "hset_zl", "list2", "zset_sl", "intset", "set1",
|
||||
"zset_zl", "hset_ht", "intkey", "strkey"));
|
||||
EXPECT_THAT(Run({"get", "intkey"}), "1234567");
|
||||
EXPECT_THAT(Run({"get", "strkey"}), "abcdefghjjjjjjjjjj");
|
||||
|
||||
resp = Run({"smembers", "intset"});
|
||||
ASSERT_THAT(resp, ArgType(RespExpr::ARRAY));
|
||||
EXPECT_THAT(resp.GetVec(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue