Skip to content

Commit

Permalink
fix(rdb_load): fix loading huge hmaps with ttl (#3825)
Browse files Browse the repository at this point in the history
  • Loading branch information
andydunstall authored Sep 30, 2024
1 parent ee2f00d commit 5d64e14
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/server/rdb_load.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,14 @@ using namespace tiering::literals;
namespace {

constexpr size_t kYieldPeriod = 50000;
constexpr size_t kMaxBlobLen = 1ULL << 12;
constexpr char kErrCat[] = "dragonfly.rdbload";

// Maximum length of each LoadTrace segment.
//
// Note kMaxBlobLen must be a multiple of 6 to avoid truncating elements
// containing 2 or 3 items.
constexpr size_t kMaxBlobLen = 4092;

inline void YieldIfNeeded(size_t i) {
if (i % kYieldPeriod == 0) {
ThisFiber::Yield();
Expand Down

0 comments on commit 5d64e14

Please sign in to comment.