jihuayu commented on code in PR #3541:
URL: https://github.com/apache/kvrocks/pull/3541#discussion_r3700974823
##########
src/commands/cmd_key.cc:
##########
@@ -372,9 +374,17 @@ class CommandDel : public Commander {
uint64_t cnt = 0;
redis::Database redis(srv->storage, conn->GetNamespace());
- auto s = redis.MDel(ctx, keys, &cnt);
+ const bool notify_del = GetAttributes()->name == "del" &&
conn->IsKeyspaceEventEnabled(kNotifyGeneric);
+ std::vector<rocksdb::Slice> deleted_keys;
+ if (notify_del) deleted_keys.reserve(keys.size());
+
+ auto s = redis.MDel(ctx, keys, &cnt, notify_del ? &deleted_keys : nullptr);
if (!s.ok()) return {Status::RedisExecErr, s.ToString()};
+ for (const auto &key : deleted_keys) {
+ conn->AddKeyspaceEvent(kNotifyGeneric, "del",
std::string_view(key.data(), key.size()));
+ }
+
Review Comment:
@Aetherance It looks like they don’t have time to look into this issue.
I’ve come up with a possible solution—do you think it would be better?
code: https://github.com/jihuayu/kvrocks/pull/6
Please note that this is only an idea, and I cannot guarantee that it is
100% correct. I’d like to hear your thoughts. You can view the diff
here.https://github.com/jihuayu/kvrocks/compare/376592a1337312749e52cb504cd965d2d711bdf3...75ca860f01c8828f82e4af62a778807c4b70e9bb
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]