mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2024-12-14 11:58:02 +00:00
fix(server): Use custom journal for multi-key PFMERGE
cmd (#2437)
While at it, also fix `PFCOUNT` to say that it's a readonly cmd. Fixed #2421
This commit is contained in:
parent
2f0287429d
commit
5586798e90
1 changed files with 8 additions and 2 deletions
|
@ -265,6 +265,11 @@ OpResult<int> PFMergeInternal(CmdArgList args, ConnectionContext* cntx) {
|
|||
return OpStatus::OUT_OF_MEMORY;
|
||||
}
|
||||
res.it->second.SetString(hll);
|
||||
|
||||
if (op_args.shard->journal()) {
|
||||
RecordJournal(op_args, "SET", ArgSlice{key, hll});
|
||||
}
|
||||
|
||||
return OpStatus::OK;
|
||||
};
|
||||
trans->Execute(std::move(set_cb), true);
|
||||
|
@ -297,8 +302,9 @@ void HllFamily::Register(CommandRegistry* registry) {
|
|||
using CI = CommandId;
|
||||
registry->StartFamily();
|
||||
*registry << CI{"PFADD", CO::WRITE, -3, 1, 1, acl::kPFAdd}.SetHandler(PFAdd)
|
||||
<< CI{"PFCOUNT", CO::WRITE, -2, 1, -1, acl::kPFCount}.SetHandler(PFCount)
|
||||
<< CI{"PFMERGE", CO::WRITE, -2, 1, -1, acl::kPFMerge}.SetHandler(PFMerge);
|
||||
<< CI{"PFCOUNT", CO::READONLY, -2, 1, -1, acl::kPFCount}.SetHandler(PFCount)
|
||||
<< CI{"PFMERGE", CO::WRITE | CO::NO_AUTOJOURNAL, -2, 1, -1, acl::kPFMerge}.SetHandler(
|
||||
PFMerge);
|
||||
}
|
||||
|
||||
const char HllFamily::kInvalidHllErr[] = "Key is not a valid HyperLogLog string value.";
|
||||
|
|
Loading…
Reference in a new issue