feat(generic_family): Assemble RESTORE and STICK commands into one commmand during replication of the RENAME command (#3209)

feat(generic_family): Assemble RESTORE and STICK commands into one commmand during RENAME replication

Signed-off-by: Stepan Bagritsevich <bagr.stepan@gmail.com>
This commit is contained in:
Stepan Bagritsevich 2024-06-24 10:48:00 +04:00 committed by GitHub
parent cf9ac35596
commit 673de8cff3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -458,13 +458,14 @@ OpStatus Renamer::DeserializeDest(Transaction* t, EngineShard* shard) {
if (shard->journal()) {
auto expire_str = absl::StrCat(serialized_value_.expire_ts);
RecordJournal(op_args, "RESTORE"sv,
ArgSlice{dest_key_, expire_str, serialized_value_.value, "REPLACE"sv, "ABSTTL"sv},
2, true);
absl::InlinedVector<std::string_view, 6> args(
{dest_key_, expire_str, serialized_value_.value, "REPLACE"sv, "ABSTTL"sv});
if (serialized_value_.sticky) {
RecordJournal(op_args, "STICK"sv, ArgSlice{dest_key_}, 2, true);
args.push_back("STICK"sv);
}
RecordJournalFinish(op_args, 2);
RecordJournal(op_args, "RESTORE"sv, args, 2);
}
return OpStatus::OK;