PragmaTwice commented on code in PR #1918:
URL: https://github.com/apache/kvrocks/pull/1918#discussion_r1413875616
##########
src/types/redis_json.cc:
##########
@@ -401,18 +401,23 @@ rocksdb::Status Json::ArrTrim(const std::string
&user_key, const std::string &pa
}
rocksdb::Status Json::Del(const std::string &user_key, const std::string
&path, size_t *result) {
- auto ns_key = AppendNamespacePrefix(user_key);
+ *result = 0;
+ auto ns_key = AppendNamespacePrefix(user_key);
LockGuard guard(storage_->GetLockManager(), ns_key);
- if (path == "$") {
- *result = 1;
- return del(ns_key);
- }
JsonValue json_val;
JsonMetadata metadata;
auto s = read(ns_key, &metadata, &json_val);
- if (!s.ok()) return s;
+ if (!s.ok() && !s.IsNotFound()) return s;
+ if (s.IsNotFound()) {
+ return rocksdb::Status::OK();
+ }
+
+ if (path == "$") {
+ *result = 1;
+ return del(ns_key);
+ }
Review Comment:
Ahhh I got why you move it here.
--
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]