From 8c7c25a9fb457f729fe2c190373d156e1816c460 Mon Sep 17 00:00:00 2001 From: Segmond Date: Mon, 7 Oct 2019 15:11:43 -0400 Subject: [PATCH 1/5] Update README.md Typo, focuses spelled as focusses Former-commit-id: 40355eac3e46c6e4bb35f5cbc315a05beff291bf --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 18db3c875..538aaf3c2 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ On the same hardware KeyDB can perform twice as many queries per second as Redis Why fork Redis? --------------- -KeyDB has a different philosophy on how the codebase should evolve. We feel that ease of use, high performance, and a "batteries included" approach is the best way to create a good user experience. While we have great respect for the Redis maintainers it is our opinion that the Redis approach focusses too much on simplicity of the code base at the expense of complexity for the user. This results in the need for external components and workarounds to solve common problems - resulting in more complexity overall. +KeyDB has a different philosophy on how the codebase should evolve. We feel that ease of use, high performance, and a "batteries included" approach is the best way to create a good user experience. While we have great respect for the Redis maintainers it is our opinion that the Redis approach focuses too much on simplicity of the code base at the expense of complexity for the user. This results in the need for external components and workarounds to solve common problems - resulting in more complexity overall. Because of this difference of opinion features which are right for KeyDB may not be appropriate for Redis. A fork allows us to explore this new development path and implement features which may never be a part of Redis. KeyDB keeps in sync with upstream Redis changes, and where applicable we upstream bug fixes and changes. It is our hope that the two projects can continue to grow and learn from each other. From dab8343cde1fa89ef293f76ba16df62f38f81ad8 Mon Sep 17 00:00:00 2001 From: eric-weaver Date: Tue, 8 Oct 2019 20:46:06 -0400 Subject: [PATCH 2/5] add missing dependency Former-commit-id: 95e3dbc1048ba99af1b64f97b681ed1e67e2431a --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index bf0c674be..931f30d59 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ FROM ubuntu:18.04 RUN apt-get update \ && DEBIAN_FRONTEND=noninteractive apt-get install -qqy \ - build-essential nasm autotools-dev autoconf libjemalloc-dev tcl tcl-dev uuid-dev \ + build-essential nasm autotools-dev autoconf libcurl4-openssl-dev libjemalloc-dev tcl tcl-dev uuid-dev \ && apt-get clean CMD make From eaabfd2038727a92ae52a777a71b04e2aaca5ad8 Mon Sep 17 00:00:00 2001 From: John Sully Date: Wed, 16 Oct 2019 12:26:48 -0400 Subject: [PATCH 3/5] Fix crash adding expire to key with a subkey expire already set Former-commit-id: 18a3768e07eb8c4feb4a666d95a19d97267ac381 --- src/server.h | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/server.h b/src/server.h index bd2b43fbc..cd2734a1d 100644 --- a/src/server.h +++ b/src/server.h @@ -805,12 +805,20 @@ public: // First check if the subkey already has an expiration for (auto &entry : m_vecexpireEntries) { - if (entry.spsubkey == nullptr) - continue; - if (sdscmp((sds)entry.spsubkey.get(), (sds)szSubkey) == 0) { - m_vecexpireEntries.erase(m_vecexpireEntries.begin() + (&entry - m_vecexpireEntries.data())); - break; + if (szSubkey != nullptr) + { + // if this is a subkey expiry then its not a match if the expireEntry is either for the + // primary key or a different subkey + if (entry.spsubkey == nullptr || sdscmp((sds)entry.spsubkey.get(), (sds)szSubkey) != 0) + continue; } + else + { + if (entry.spsubkey != nullptr) + continue; + } + m_vecexpireEntries.erase(m_vecexpireEntries.begin() + (&entry - m_vecexpireEntries.data())); + break; } auto itrInsert = std::lower_bound(m_vecexpireEntries.begin(), m_vecexpireEntries.end(), when); const char *subkey = (szSubkey) ? sdsdup(szSubkey) : nullptr; From ac14b6ac7d53e6cecb85b39a90b4cfafeb85c02b Mon Sep 17 00:00:00 2001 From: John Sully Date: Wed, 16 Oct 2019 12:27:04 -0400 Subject: [PATCH 4/5] expiremember should return the same results as expire Former-commit-id: 8f1295c00f27b6c89785236c5199c1623773940d --- src/expire.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/expire.cpp b/src/expire.cpp index 3df9436fd..6ef892fee 100644 --- a/src/expire.cpp +++ b/src/expire.cpp @@ -168,7 +168,7 @@ void expireMemberCore(client *c, robj *key, robj *subkey, long long basetime, lo { case OBJ_SET: if (!setTypeIsMember(val, szFromObj(subkey))) { - addReplyError(c, "subkey does not exist"); + addReply(c,shared.czero); return; } break; @@ -180,7 +180,7 @@ void expireMemberCore(client *c, robj *key, robj *subkey, long long basetime, lo setExpire(c, c->db, key, subkey, when); - addReply(c, shared.ok); + addReply(c, shared.cone); } void expireMemberCommand(client *c) From 10561c2e57e61cb807dab8e66b2886a3c373fee2 Mon Sep 17 00:00:00 2001 From: "john@csquare.ca" Date: Wed, 16 Oct 2019 12:38:15 -0400 Subject: [PATCH 5/5] Fix: ExpireMember does not update MVCC timestamp Former-commit-id: f5210a8fb0704336e9734076b52a862698820f3a --- src/expire.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/expire.cpp b/src/expire.cpp index 6ef892fee..62b5e7a6e 100644 --- a/src/expire.cpp +++ b/src/expire.cpp @@ -156,14 +156,11 @@ void expireMemberCore(client *c, robj *key, robj *subkey, long long basetime, lo when += basetime; /* No key, return zero. */ - dictEntry *de = dictFind(c->db->pdict, szFromObj(key)); - if (de == NULL) { - addReply(c,shared.czero); + robj *val = lookupKeyWriteOrReply(c, key, shared.czero); + if (val == NULL) { return; } - robj *val = (robj*)dictGetVal(de); - switch (val->type) { case OBJ_SET: