Skip to content
This repository has been archived by the owner on Feb 20, 2021. It is now read-only.

Commit

Permalink
Merge version 2.8.19 from antirez into 2.8
Browse files Browse the repository at this point in the history
  • Loading branch information
orangemocha committed Dec 26, 2014
2 parents bc2ce9d + 902b877 commit 69ff2fe
Show file tree
Hide file tree
Showing 20 changed files with 133 additions and 75 deletions.
30 changes: 30 additions & 0 deletions 00-RELEASENOTES
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,36 @@ HIGH: There is a critical bug that may affect a subset of users. Upgrade!
CRITICAL: There is a critical bug affecting MOST USERS. Upgrade ASAP.
--------------------------------------------------------------------------------

--[ Redis 2.8.19 ] Release date: 16 Dec 2014

# UPGRADE URGENCY: LOW for both Redis and Sentinel. This release mostly
fixes small issues.

02d465c Don't log admin commands in MONITOR. (antirez)
4d8f426 List of commands flagged as admin commands modified. (antirez)
e47e460 Lua cmsgpack lib updated to latest version. (antirez)
5509c14 Add symlink to redis-sentinel during make install (Rhommel Lamas)
7de1ef7 SORT: Don't sort Set elements if not needed. (antirez)
e945a54 Fix zero-ordering SORT when called against lists (Matt Stancliff)
d81c383 Update redis_init_script.tpl (Ben Dowling)
dba57ea FIXED redis-benchmark's idle mode.With idle mode shouldn't create write event (zhanghailei)
888ea17 zipmap.c: update comments above (Sun He)
86ebc13 replaced // comments #2150 (Deepak Verma)
3d73f08 redis-benchmark AUTH command to be discarded after the first send #2150 (azure provisioned user)
76d53a6 sds.c: Correct two spelling mistakes in comments (Sun He)
4848cf9 sds.c/sdscatvprintf: set va_end to finish va_list cpy (Sun He)
d2f584f sds.c: Correct some comments (Sun He)
2ed3f09 Update whatisdoing.sh (Serghei Iakovlev)
77b997d Include stropts only if __sun is defined. (antirez)
d409371 Fix implicit declaration of ioctl on Solaris (Jan-Erik Rediger)
23b96c0 Silence _BSD_SOURCE warnings in glibc 2.20 and forward (Johan Bergström)
a47a042 Mark whatisdoing.sh as deprecated in top-comment. (antirez)
b5737d2 getting pid fixes (Serghei Iakovlev)
a598e08 sparkline.c: AddSample skip Empty label (Sun He)
7d480ab sparkline.c: mov label-ini into the AddSample Function (Sun He)
2f3c860 Only ignore sigpipe in interactive mode (Jan-Erik Rediger)
0c211a1 Simplify lua_cmsgpack macro and fix build on old Linux distros. (antirez)

--[ Redis 2.8.18 ] Release date: 4 Dec 2014

# UPGRADE URGENCY: LOW for both Redis and Sentinel. This release mostly
Expand Down
61 changes: 28 additions & 33 deletions deps/lua/src/lua_cmsgpack.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,8 @@
#define LUACMSGPACK_MAX_NESTING 16 /* Max tables nesting. */
#endif

#if (_XOPEN_SOURCE >= 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L)
#define IS_FINITE(x) isfinite(x)
#else
#define IS_FINITE(x) ((x) == (x) && (x) + 1 > (x))
#endif

/* Check if float or double can be an integer without loss of precision */
#define IS_INT_TYPE_EQUIVALENT(x, T) (IS_FINITE(x) && (T)(x) == (x))
#define IS_INT_TYPE_EQUIVALENT(x, T) (!isinf(x) && (T)(x) == (x))

#define IS_INT64_EQUIVALENT(x) IS_INT_TYPE_EQUIVALENT(x, int64_t)
#define IS_INT_EQUIVALENT(x) IS_INT_TYPE_EQUIVALENT(x, int)
Expand All @@ -37,12 +31,10 @@
#define BITS_32 0
#endif

#if LUA_VERSION_NUM < 503
#if BITS_32
#define lua_pushunsigned(L, n) lua_pushnumber(L, n)
#else
#define lua_pushunsigned(L, n) lua_pushinteger(L, n)
#endif
#if BITS_32
#define lua_pushunsigned(L, n) lua_pushnumber(L, n)
#else
#define lua_pushunsigned(L, n) lua_pushinteger(L, n)
#endif

/* =============================================================================
Expand Down Expand Up @@ -262,7 +254,7 @@ static void mp_encode_int(mp_buf *buf, int64_t n) {
}
} else {
if (n >= -32) {
b[0] = ((char)n); /* negative fixnum */
b[0] = ((signed char)n); /* negative fixnum */
enclen = 1;
} else if (n >= -128) {
b[0] = 0xd0; /* int 8 */
Expand Down Expand Up @@ -550,6 +542,7 @@ static int mp_pack(lua_State *L) {
void mp_decode_to_lua_type(lua_State *L, mp_cur *c);

void mp_decode_to_lua_array(lua_State *L, mp_cur *c, size_t len) {
assert(len <= UINT_MAX);
int index = 1;

lua_newtable(L);
Expand All @@ -562,6 +555,7 @@ void mp_decode_to_lua_array(lua_State *L, mp_cur *c, size_t len) {
}

void mp_decode_to_lua_hash(lua_State *L, mp_cur *c, size_t len) {
assert(len <= UINT_MAX);
lua_newtable(L);
while(len--) {
mp_decode_to_lua_type(L,c); /* key */
Expand Down Expand Up @@ -594,7 +588,7 @@ void mp_decode_to_lua_type(lua_State *L, mp_cur *c) {
break;
case 0xd0: /* int 8 */
mp_cur_need(c,2);
lua_pushinteger(L,(char)c->p[1]);
lua_pushinteger(L,(signed char)c->p[1]);
mp_cur_consume(c,2);
break;
case 0xcd: /* uint 16 */
Expand Down Expand Up @@ -705,13 +699,14 @@ void mp_decode_to_lua_type(lua_State *L, mp_cur *c) {
case 0xdb: /* raw 32 */
mp_cur_need(c,5);
{
size_t l = (c->p[1] << 24) |
(c->p[2] << 16) |
(c->p[3] << 8) |
c->p[4];
mp_cur_need(c,5+l);
lua_pushlstring(L,(char*)c->p+5,l);
mp_cur_consume(c,5+l);
size_t l = ((size_t)c->p[1] << 24) |
((size_t)c->p[2] << 16) |
((size_t)c->p[3] << 8) |
(size_t)c->p[4];
mp_cur_consume(c,5);
mp_cur_need(c,l);
lua_pushlstring(L,(char*)c->p,l);
mp_cur_consume(c,l);
}
break;
case 0xdc: /* array 16 */
Expand All @@ -725,10 +720,10 @@ void mp_decode_to_lua_type(lua_State *L, mp_cur *c) {
case 0xdd: /* array 32 */
mp_cur_need(c,5);
{
size_t l = (c->p[1] << 24) |
(c->p[2] << 16) |
(c->p[3] << 8) |
c->p[4];
size_t l = ((size_t)c->p[1] << 24) |
((size_t)c->p[2] << 16) |
((size_t)c->p[3] << 8) |
(size_t)c->p[4];
mp_cur_consume(c,5);
mp_decode_to_lua_array(L,c,l);
}
Expand All @@ -744,10 +739,10 @@ void mp_decode_to_lua_type(lua_State *L, mp_cur *c) {
case 0xdf: /* map 32 */
mp_cur_need(c,5);
{
size_t l = (c->p[1] << 24) |
(c->p[2] << 16) |
(c->p[3] << 8) |
c->p[4];
size_t l = ((size_t)c->p[1] << 24) |
((size_t)c->p[2] << 16) |
((size_t)c->p[3] << 8) |
(size_t)c->p[4];
mp_cur_consume(c,5);
mp_decode_to_lua_hash(L,c,l);
}
Expand Down Expand Up @@ -836,15 +831,15 @@ static int mp_unpack(lua_State *L) {
}

static int mp_unpack_one(lua_State *L) {
int offset = luaL_optint(L, 2, 0);
int offset = luaL_optinteger(L, 2, 0);
/* Variable pop because offset may not exist */
lua_pop(L, lua_gettop(L)-1);
return mp_unpack_full(L, 1, offset);
}

static int mp_unpack_limit(lua_State *L) {
int limit = luaL_checkint(L, 2);
int offset = luaL_optint(L, 3, 0);
int limit = luaL_checkinteger(L, 2);
int offset = luaL_optinteger(L, 3, 0);
/* Variable pop because offset may not exist */
lua_pop(L, lua_gettop(L)-1);

Expand Down
4 changes: 2 additions & 2 deletions msvs/setups/chocolatey/Redis.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<metadata>
<id>redis-64</id>
<title>redis-64</title>
<version>2.8.18</version>
<version>2.8.19</version>
<authors>Jonathan Pickett</authors>
<owners>Microsoft Open Technologies, Inc.</owners>
<summary>Redis is a very popular open-source, networked, in-memory, key-value data store known for high performance, flexibility, a rich set of data structures, and a simple straightforward API.</summary>
Expand All @@ -14,7 +14,7 @@
<licenseUrl>https://github.com/MSOpenTech/redis/blob/2.8/license.txt</licenseUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<iconUrl>http://redis.io/images/redis.png</iconUrl>
<releaseNotes>Includes the changes from Redis 2.8.12 -> 2.8.18. Please see the release notes for the UNIX 2.8 branch to understand how this impacts Redis functionality.</releaseNotes>
<releaseNotes>Includes the changes from Redis 2.8.12 -> 2.8.19. Please see the release notes for the UNIX 2.8 branch to understand how this impacts Redis functionality.</releaseNotes>
</metadata>
<files>
<file src="..\signed_binaries\*.*" target=".\" />
Expand Down
Binary file modified msvs/setups/documentation/Redis on Windows Release Notes.docx
Binary file not shown.
4 changes: 2 additions & 2 deletions msvs/setups/nuget/Redis.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<metadata>
<id>redis-64</id>
<title>redis-64</title>
<version>2.8.18</version>
<version>2.8.19</version>
<authors>Jonathan Pickett</authors>
<owners>Microsoft Open Technologies, Inc.</owners>
<summary>Redis is a very popular open-source, networked, in-memory, key-value data store known for high performance, flexibility, a rich set of data structures, and a simple straightforward API.</summary>
Expand All @@ -14,7 +14,7 @@
<licenseUrl>https://github.com/MSOpenTech/redis/blob/2.8/license.txt</licenseUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<iconUrl>http://redis.io/images/redis.png</iconUrl>
<releaseNotes>Includes the changes from Redis 2.8.12 -> 2.8.18. Please see the release notes for the UNIX 2.8 branch to understand how this impacts Redis functionality.</releaseNotes>
<releaseNotes>Includes the changes from Redis 2.8.12 -> 2.8.19. Please see the release notes for the UNIX 2.8 branch to understand how this impacts Redis functionality.</releaseNotes>
</metadata>
<files>
<file src="..\signed_binaries\*.*" target=".\" />
Expand Down
1 change: 1 addition & 0 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -251,3 +251,4 @@ install: all
$(REDIS_INSTALL) $(REDIS_CLI_NAME) $(INSTALL_BIN)
$(REDIS_INSTALL) $(REDIS_CHECK_DUMP_NAME) $(INSTALL_BIN)
$(REDIS_INSTALL) $(REDIS_CHECK_AOF_NAME) $(INSTALL_BIN)
@ln -sf $(INSTALL_BIN)/$(REDIS_SERVER_NAME) $(INSTALL_BIN)/$(REDIS_SENTINEL_NAME)
1 change: 1 addition & 0 deletions src/fmacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

#if defined(__linux__)
#define _GNU_SOURCE
#define _DEFAULT_SOURCE
#endif

#if defined(_AIX)
Expand Down
4 changes: 1 addition & 3 deletions src/latency.c
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,6 @@ sds latencyCommandGenSparkeline(char *event, struct latencyTimeSeries *ts) {
for (j = 0; j < LATENCY_TS_LEN; j++) {
int i = (ts->idx + j) % LATENCY_TS_LEN;
int elapsed;
char *label;
char buf[64];

if (ts->samples[i].time == 0) continue;
Expand All @@ -534,8 +533,7 @@ sds latencyCommandGenSparkeline(char *event, struct latencyTimeSeries *ts) {
snprintf(buf,sizeof(buf),"%dh",elapsed/3600);
else
snprintf(buf,sizeof(buf),"%dd",elapsed/(3600*24));
label = zstrdup(buf);
sparklineSequenceAddSample(seq,ts->samples[i].latency,label);
sparklineSequenceAddSample(seq,ts->samples[i].latency,buf);
}

graph = sdscatprintf(graph,
Expand Down
3 changes: 3 additions & 0 deletions src/memtest.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
#ifndef _WIN32
#include <termios.h>
#include <sys/ioctl.h>
#if defined(__sun)
#include <stropts.h>
#endif
#else
#include "win32_Interop/win32fixes.h"
#include "win32_Interop/win32_ANSI.h"
Expand Down
11 changes: 8 additions & 3 deletions src/redis-benchmark.c
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,8 @@ static client createClient(char *cmd, size_t len, client from) {
}
}
}
aeCreateFileEvent(config.el,c->context->fd,AE_WRITABLE,writeHandler,c);
if (config.idlemode == 0)
aeCreateFileEvent(config.el,c->context->fd,AE_WRITABLE,writeHandler,c);
listAddNodeTail(config.clients,c);
config.liveclients++;
return c;
Expand Down Expand Up @@ -682,9 +683,13 @@ int showThroughput(struct aeEventLoop *eventLoop, long long id, void *clientData
if (config.liveclients == 0) {
fprintf(stderr,"All clients disconnected... aborting.\n");
exit(1);
}

}
if (config.csv) return 250;
if (config.idlemode == 1) {
printf("clients: %d\r", config.liveclients);
fflush(stdout);
return 250;
}
dt = (float)((mstime()-config.start)/1000.0);
rps = (float)(config.requests_finished/dt);
printf("%s: %.2f\r", config.title, rps);
Expand Down
5 changes: 3 additions & 2 deletions src/redis-cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -1960,8 +1960,6 @@ int main(int argc, char **argv) {
argc -= firstarg;
argv += firstarg;

signal(SIGPIPE, SIG_IGN);

/* Latency mode */
if (config.latency_mode) {
if (cliConnect(0) == REDIS_ERR) exit(1);
Expand Down Expand Up @@ -2010,6 +2008,9 @@ int main(int argc, char **argv) {

/* Start interactive mode when no command is provided */
if (argc == 0 && !config.eval) {
/* Ignore SIGPIPE in interactive mode to force a reconnect */
signal(SIGPIPE, SIG_IGN);

/* Note that in repl mode we don't abort on connection error.
* A new attempt will be performed for every command send. */
cliConnect(0);
Expand Down
14 changes: 7 additions & 7 deletions src/redis.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ struct redisCommand redisCommandTable[] = {
{"pttl",pttlCommand,2,"rF",0,NULL,1,1,1,0,0},
{"persist",persistCommand,2,"wF",0,NULL,1,1,1,0,0},
{"slaveof",slaveofCommand,3,"ast",0,NULL,0,0,0,0,0},
{"role",roleCommand,1,"last",0,NULL,0,0,0,0,0},
{"role",roleCommand,1,"lst",0,NULL,0,0,0,0,0},
{"debug",debugCommand,-2,"as",0,NULL,0,0,0,0,0},
{"config",configCommand,-2,"art",0,NULL,0,0,0,0,0},
{"subscribe",subscribeCommand,-2,"rpslt",0,NULL,0,0,0,0,0},
Expand All @@ -264,15 +264,15 @@ struct redisCommand redisCommandTable[] = {
{"pubsub",pubsubCommand,-2,"pltrR",0,NULL,0,0,0,0,0},
{"watch",watchCommand,-2,"rsF",0,NULL,1,-1,1,0,0},
{"unwatch",unwatchCommand,1,"rsF",0,NULL,0,0,0,0,0},
{"restore",restoreCommand,4,"awm",0,NULL,1,1,1,0,0},
{"migrate",migrateCommand,6,"aw",0,NULL,0,0,0,0,0},
{"dump",dumpCommand,2,"ar",0,NULL,1,1,1,0,0},
{"restore",restoreCommand,4,"wm",0,NULL,1,1,1,0,0},
{"migrate",migrateCommand,6,"w",0,NULL,0,0,0,0,0},
{"dump",dumpCommand,2,"r",0,NULL,1,1,1,0,0},
{"object",objectCommand,3,"r",0,NULL,2,2,2,0,0},
{"client",clientCommand,-2,"ars",0,NULL,0,0,0,0,0},
{"client",clientCommand,-2,"rs",0,NULL,0,0,0,0,0},
{"eval",evalCommand,-3,"s",0,zunionInterGetKeys,0,0,0,0,0},
{"evalsha",evalShaCommand,-3,"s",0,zunionInterGetKeys,0,0,0,0,0},
{"slowlog",slowlogCommand,-2,"r",0,NULL,0,0,0,0,0},
{"script",scriptCommand,-2,"ras",0,NULL,0,0,0,0,0},
{"script",scriptCommand,-2,"rs",0,NULL,0,0,0,0,0},
{"time",timeCommand,1,"rRF",0,NULL,0,0,0,0,0},
{"bitop",bitopCommand,-4,"wm",0,NULL,2,-1,1,0,0},
{"bitcount",bitcountCommand,-2,"r",0,NULL,1,1,1,0,0},
Expand Down Expand Up @@ -2024,7 +2024,7 @@ void call(redisClient *c, int flags) {
* not generated from reading an AOF. */
if (listLength(server.monitors) &&
!server.loading &&
!(c->cmd->flags & REDIS_CMD_SKIP_MONITOR))
!(c->cmd->flags & (REDIS_CMD_SKIP_MONITOR|REDIS_CMD_ADMIN)))
{
replicationFeedMonitors(c,server.monitors,c->db->id,c->argv,c->argc);
}
Expand Down
12 changes: 6 additions & 6 deletions src/sds.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ sds sdscpy(sds s, const char *t) {
* conversion. 's' must point to a string with room for at least
* SDS_LLSTR_SIZE bytes.
*
* The function returns the lenght of the null-terminated string
* The function returns the length of the null-terminated string
* representation stored at 's'. */
#define SDS_LLSTR_SIZE 21
int sdsll2str(char *s, long long value) {
Expand Down Expand Up @@ -372,7 +372,7 @@ sds sdsfromlonglong(long long value) {
return sdsnewlen(buf,len);
}

/* Like sdscatpritf() but gets va_list instead of being variadic. */
/* Like sdscatprintf() but gets va_list instead of being variadic. */
sds sdscatvprintf(sds s, const char *fmt, va_list ap) {
va_list cpy;
char staticbuf[1024], *buf = staticbuf, *t;
Expand All @@ -398,7 +398,7 @@ sds sdscatvprintf(sds s, const char *fmt, va_list ap) {
#else
vsnprintf(buf, buflen, fmt, cpy);
#endif
va_end(ap);
va_end(cpy);
if (buf[buflen-2] != '\0') {
if (buf != staticbuf) zfree(buf);
buflen *= 2;
Expand Down Expand Up @@ -431,7 +431,7 @@ sds sdscatvprintf(sds s, const char *fmt, va_list ap) {
*
* Example:
*
* s = sdsempty("Sum is: ");
* s = sdsnew("Sum is: ");
* s = sdscatprintf(s,"%d+%d = %d",a,b,a+b).
*
* Often you need to create a string from scratch with the printf-alike
Expand Down Expand Up @@ -659,8 +659,8 @@ void sdstoupper(sds s) {
*
* Return value:
*
* 1 if s1 > s2.
* -1 if s1 < s2.
* positive if s1 > s2.
* negative if s1 < s2.
* 0 if s1 and s2 are exactly the same binary string.
*
* If two strings share exactly the same prefix, but one of the two has
Expand Down
Loading

0 comments on commit 69ff2fe

Please sign in to comment.