mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-11 02:15:45 +02:00
feat(cluster): Add RestoreStreamer
. (#2390)
* feat(cluster): Add `RestoreStreamer`. `RestoreStreamer`, like `JournalStreamer`, streams journal changes to a sink. However, in addition, it traverses the DB like `RdbSerializer` and sends existing entries as `RESTORE` commands. Adding it required a bit of plumbing to get all journal changes to be slot-aware. In a follow-up PR I will remove the now unneeded `SerializerBase`. * Fix build * Fix bug * Remove unimplemented function * Iterate DB, drop support for db1+ * Send FULL-SYNC-CUT
This commit is contained in:
parent
f4ea42f2f6
commit
4874da8b5b
23 changed files with 311 additions and 99 deletions
|
@ -1279,12 +1279,11 @@ void DbSlice::FreeMemWithEvictionStep(DbIndex db_ind, size_t increase_goal_bytes
|
|||
finish:
|
||||
// send the deletion to the replicas.
|
||||
// fiber preemption could happen in this phase.
|
||||
vector<string_view> args(keys_to_journal.begin(), keys_to_journal.end());
|
||||
if (!args.empty()) {
|
||||
ArgSlice delete_args(&args[0], args.size());
|
||||
if (auto journal = owner_->journal(); journal) {
|
||||
journal->RecordEntry(0, journal::Op::EXPIRED, db_ind, 1, make_pair("DEL", delete_args),
|
||||
false);
|
||||
if (auto journal = owner_->journal(); journal) {
|
||||
for (string_view key : keys_to_journal) {
|
||||
ArgSlice delete_args(&key, 1);
|
||||
journal->RecordEntry(0, journal::Op::EXPIRED, db_ind, 1, ClusterConfig::KeySlot(key),
|
||||
make_pair("DEL", delete_args), false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue