Merge branch 'unstable' of https://github.com/JohnSully/KeyDB into unstable

Former-commit-id: 762396d997b4e155778ba62346376b37b4673154
This commit is contained in:
John Sully 2020-01-11 16:35:06 -05:00
commit ac55fe6dac
4 changed files with 41 additions and 2 deletions

View File

@ -13,7 +13,9 @@ KeyDB maintains full compatibility with the Redis protocol, modules, and scripts
On the same hardware KeyDB can perform twice as many queries per second as Redis, with 60% lower latency. Active-Replication simplifies hot-spare failover allowing you to easily distribute writes over replicas and use simple TCP based load balancing/failover. KeyDB's higher performance allows you to do more on less hardware which reduces operation costs and complexity.
<img src=https://cdn-images-1.medium.com/max/1400/1*s7mTb7Qb0kxc951mz8bdgA.png width=420 height=300/><img src=https://cdn-images-1.medium.com/max/1400/1*R00A5U4AFGohGOYHMfT6fA.png height=300/>
<img src="https://keydb.dev/assets/img/blog/5x_opspersecVSdatasize.PNG"/>
See the full benchmark results and setup information here: https://docs.keydb.dev/blog/2019/10/07/blog-post/
Why fork Redis?
---------------

View File

@ -804,6 +804,7 @@ void loadServerConfigFromString(char *config) {
// NOP, handled in main
} else if (!strcasecmp(argv[0],"enable-pro")) {
cserver.fUsePro = true;
break;
} else {
err = "Bad directive or wrong number of arguments"; goto loaderr;
}

View File

@ -5199,7 +5199,10 @@ int main(int argc, char **argv) {
}
if (cserver.fUsePro) {
execv("keydb-pro-server", argv);
const char *keydb_pro_dir = getenv("KEYDB_PRO_DIRECTORY");
sds path = sdsnew(keydb_pro_dir);
path = sdscat(path, "keydb-pro-server");
execv(path, argv);
perror("Failed launch the pro binary");
exit(EXIT_FAILURE);
}

View File

@ -219,4 +219,37 @@ start_server {tags {"expire"}} {
set ttl [r ttl foo]
assert {$ttl <= 98 && $ttl > 90}
}
test { EXPIREMEMBER works (set) } {
r flushall
r sadd testkey foo bar baz
r expiremember testkey foo 1
after 1500
assert_equal {2} [r scard testkey]
}
test { EXPIREMEMBER works (hash) } {
r flushall
r hset testkey foo bar
r expiremember testkey foo 1
after 1500
r exists testkey
} {0}
test { EXPIREMEMBER works (zset) } {
r flushall
r zadd testkey 1 foo
r zadd testkey 2 bar
assert_equal {2} [r zcard testkey]
r expiremember testkey foo 1
after 1500
assert_equal {1} [r zcard testkey]
}
test { TTL for subkey expires works } {
r flushall
r sadd testkey foo bar baz
r expiremember testkey foo 10000
assert [expr [r ttl testkey foo] > 0]
}
}