Skip to content

Commit

Permalink
Release Redis 7.2.0 GA
Browse files Browse the repository at this point in the history
  • Loading branch information
oranagra committed Aug 15, 2023
2 parents 1a58981 + 3d1d3e2 commit 2962227
Show file tree
Hide file tree
Showing 44 changed files with 342 additions and 83 deletions.
21 changes: 21 additions & 0 deletions 00-RELEASENOTES
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,27 @@ CRITICAL: There is a critical bug affecting MOST USERS. Upgrade ASAP.
SECURITY: There are security fixes in the release.
--------------------------------------------------------------------------------

================================================================================
Redis 7.2.0 GA Released Mon Aug 15 12:00:00 IDT 2023
================================================================================

Upgrade urgency LOW: This is the first stable Release for Redis 7.2.

Bug Fixes
=========

* redis-cli in cluster mode handles `unknown-endpoint` (#12273)
* Update request / response policy hints for a few commands (#12417)
* Ensure that the function load timeout is disabled during loading from RDB/AOF and on replicas. (#12451)
* Fix false success and a memory leak for ACL selector with bad parenthesis combination (#12452)
* Fix the assertion when script timeout occurs after it signaled a blocked client (#12459)

Fixes for issues in previous releases of Redis 7.2
--------------------------------------------------

* Update MONITOR client's memory correctly for INFO and client-eviction (#12420)
* The response of cluster nodes was unnecessarily adding an extra comma when no
hostname was present. (#12411)

================================================================================
Redis 7.2 RC3 Released Mon July 10 12:00:00 IDT 2023
Expand Down
4 changes: 4 additions & 0 deletions deps/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ Hiredis

Hiredis is used by Sentinel, `redis-cli` and `redis-benchmark`. Like Redis, uses the SDS string library, but not necessarily the same version. In order to avoid conflicts, this version has all SDS identifiers prefixed by `hi`.

1. `git subtree pull --prefix deps/hiredis https://github.com/redis/hiredis.git <version-tag> --squash`<br>
This should hopefully merge the local changes into the new version.
2. Conflicts will arise (due to our changes) you'll need to resolve them and commit.

Linenoise
---

Expand Down
4 changes: 2 additions & 2 deletions deps/hiredis/.github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ jobs:

- name: Install dependencies
run: |
brew install openssl redis@6.2
brew link redis@6.2 --force
brew install openssl redis@7.0
brew link redis@7.0 --force
- name: Build hiredis
run: USE_SSL=1 make
Expand Down
2 changes: 1 addition & 1 deletion deps/hiredis/.github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
steps:
- name: Install qemu
if: matrix.emulator
run: sudo apt-get install -y qemu-user
run: sudo apt-get update && sudo apt-get install -y qemu-user
- name: Install platform toolset
if: matrix.toolset
run: sudo apt-get install -y gcc-${{matrix.toolset}}
Expand Down
57 changes: 54 additions & 3 deletions deps/hiredis/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,71 @@
## [1.2.0](https://github.com/redis/hiredis/tree/v1.2.0) - (2023-06-04)

Announcing Hiredis v1.2.0 with with new adapters, and a great many bug fixes.

## 🚀 New Features

- Add sdevent adapter @Oipo (#1144)
- Allow specifying the keepalive interval @michael-grunder (#1168)
- Add RedisModule adapter @tezc (#1182)
- Helper for setting TCP_USER_TIMEOUT socket option @zuiderkwast (#1188)

## 🐛 Bug Fixes

- Fix a typo in b6a052f. @yossigo (#1190)
- Fix wincrypt symbols conflict @hudayou (#1151)
- Don't attempt to set a timeout if we are in an error state. @michael-grunder (#1180)
- Accept -nan per the RESP3 spec recommendation. @michael-grunder (#1178)
- Fix colliding option values @zuiderkwast (#1172)
- Ensure functionality without `_MSC_VER` definition @windyakin (#1194)

## 🧰 Maintenance

- Add a test for the TCP_USER_TIMEOUT option. @michael-grunder (#1192)
- Add -Werror as a default. @yossigo (#1193)
- CI: Update homebrew Redis version. @yossigo (#1191)
- Fix typo in makefile. @michael-grunder (#1179)
- Write a version file for the CMake package @Neverlord (#1165)
- CMakeLists.txt: respect BUILD_SHARED_LIBS @ffontaine (#1147)
- Cmake static or shared @autoantwort (#1160)
- fix typo @tillkruss (#1153)
- Add a test ensuring we don't clobber connection error. @michael-grunder (#1181)
- Search for openssl on macOS @michael-grunder (#1169)


## Contributors
We'd like to thank all the contributors who worked on this release!

<a href="https://github.com/neverlord"><img src="https://github.com/neverlord.png" width="32" height="32"></a>
<a href="https://github.com/Oipo"><img src="https://github.com/Oipo.png" width="32" height="32"></a>
<a href="https://github.com/autoantwort"><img src="https://github.com/autoantwort.png" width="32" height="32"></a>
<a href="https://github.com/ffontaine"><img src="https://github.com/ffontaine.png" width="32" height="32"></a>
<a href="https://github.com/hudayou"><img src="https://github.com/hudayou.png" width="32" height="32"></a>
<a href="https://github.com/michael-grunder"><img src="https://github.com/michael-grunder.png" width="32" height="32"></a>
<a href="https://github.com/postgraph"><img src="https://github.com/postgraph.png" width="32" height="32"></a>
<a href="https://github.com/tezc"><img src="https://github.com/tezc.png" width="32" height="32"></a>
<a href="https://github.com/tillkruss"><img src="https://github.com/tillkruss.png" width="32" height="32"></a>
<a href="https://github.com/vityafx"><img src="https://github.com/vityafx.png" width="32" height="32"></a>
<a href="https://github.com/windyakin"><img src="https://github.com/windyakin.png" width="32" height="32"></a>
<a href="https://github.com/yossigo"><img src="https://github.com/yossigo.png" width="32" height="32"></a>
<a href="https://github.com/zuiderkwast"><img src="https://github.com/zuiderkwast.png" width="32" height="32"></a>

## [1.1.0](https://github.com/redis/hiredis/tree/v1.1.0) - (2022-11-15)

Announcing Hiredis v1.1.0 GA with better SSL convenience, new async adapters and a great many bug fixes.

**NOTE**: Hiredis can now return `nan` in addition to `-inf` and `inf` when returning a `REDIS_REPLY_DOUBLE`.
**NOTE**: Hiredis can now return `nan` in addition to `-inf` and `inf` when returning a `REDIS_REPLY_DOUBLE`.

## 🐛 Bug Fixes

- Add support for nan in RESP3 double [@filipecosta90](https://github.com/filipecosta90)
- Add support for nan in RESP3 double [@filipecosta90](https://github.com/filipecosta90)
([\#1133](https://github.com/redis/hiredis/pull/1133))

## 🧰 Maintenance

- Add an example that calls redisCommandArgv [@michael-grunder](https://github.com/michael-grunder)
([\#1140](https://github.com/redis/hiredis/pull/1140))
- fix flag reference [@pata00](https://github.com/pata00) ([\#1136](https://github.com/redis/hiredis/pull/1136))
- Make freeing a NULL redisAsyncContext a no op. [@michael-grunder](https://github.com/michael-grunder)
- Make freeing a NULL redisAsyncContext a no op. [@michael-grunder](https://github.com/michael-grunder)
([\#1135](https://github.com/redis/hiredis/pull/1135))
- CI updates ([@bjosv](https://github.com/redis/bjosv) ([\#1139](https://github.com/redis/hiredis/pull/1139))

Expand Down
6 changes: 3 additions & 3 deletions deps/hiredis/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export REDIS_TEST_CONFIG
CC:=$(shell sh -c 'type $${CC%% *} >/dev/null 2>/dev/null && echo $(CC) || echo gcc')
CXX:=$(shell sh -c 'type $${CXX%% *} >/dev/null 2>/dev/null && echo $(CXX) || echo g++')
OPTIMIZATION?=-O3
WARNINGS=-Wall -W -Wstrict-prototypes -Wwrite-strings -Wno-missing-field-initializers
WARNINGS=-Wall -Wextra -Werror -Wstrict-prototypes -Wwrite-strings -Wno-missing-field-initializers
DEBUG_FLAGS?= -g -ggdb
REAL_CFLAGS=$(OPTIMIZATION) -fPIC $(CPPFLAGS) $(CFLAGS) $(WARNINGS) $(DEBUG_FLAGS) $(PLATFORM_FLAGS)
REAL_LDFLAGS=$(LDFLAGS)
Expand Down Expand Up @@ -311,7 +311,7 @@ install: $(DYLIBNAME) $(STLIBNAME) $(PKGCONFNAME) $(SSL_INSTALL)
$(INSTALL) hiredis.h async.h read.h sds.h alloc.h sockcompat.h $(INSTALL_INCLUDE_PATH)
$(INSTALL) adapters/*.h $(INSTALL_INCLUDE_PATH)/adapters
$(INSTALL) $(DYLIBNAME) $(INSTALL_LIBRARY_PATH)/$(DYLIB_MINOR_NAME)
cd $(INSTALL_LIBRARY_PATH) && ln -sf $(DYLIB_MINOR_NAME) $(DYLIBNAME)
cd $(INSTALL_LIBRARY_PATH) && ln -sf $(DYLIB_MINOR_NAME) $(DYLIBNAME) && ln -sf $(DYLIB_MINOR_NAME) $(DYLIB_MAJOR_NAME)
$(INSTALL) $(STLIBNAME) $(INSTALL_LIBRARY_PATH)
mkdir -p $(INSTALL_PKGCONF_PATH)
$(INSTALL) $(PKGCONFNAME) $(INSTALL_PKGCONF_PATH)
Expand All @@ -320,7 +320,7 @@ install-ssl: $(SSL_DYLIBNAME) $(SSL_STLIBNAME) $(SSL_PKGCONFNAME)
mkdir -p $(INSTALL_INCLUDE_PATH) $(INSTALL_LIBRARY_PATH)
$(INSTALL) hiredis_ssl.h $(INSTALL_INCLUDE_PATH)
$(INSTALL) $(SSL_DYLIBNAME) $(INSTALL_LIBRARY_PATH)/$(SSL_DYLIB_MINOR_NAME)
cd $(INSTALL_LIBRARY_PATH) && ln -sf $(SSL_DYLIB_MINOR_NAME) $(SSL_DYLIBNAME)
cd $(INSTALL_LIBRARY_PATH) && ln -sf $(SSL_DYLIB_MINOR_NAME) $(SSL_DYLIBNAME) && ln -sf $(SSL_DYLIB_MINOR_NAME) $(SSL_DYLIB_MAJOR_NAME)
$(INSTALL) $(SSL_STLIBNAME) $(INSTALL_LIBRARY_PATH)
mkdir -p $(INSTALL_PKGCONF_PATH)
$(INSTALL) $(SSL_PKGCONFNAME) $(INSTALL_PKGCONF_PATH)
Expand Down
4 changes: 2 additions & 2 deletions deps/hiredis/hiredis.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,12 +392,12 @@ int redisvFormatCommand(char **target, const char *format, va_list ap) {
while (*_p != '\0' && strchr(flags,*_p) != NULL) _p++;

/* Field width */
while (*_p != '\0' && isdigit(*_p)) _p++;
while (*_p != '\0' && isdigit((int) *_p)) _p++;

/* Precision */
if (*_p == '.') {
_p++;
while (*_p != '\0' && isdigit(*_p)) _p++;
while (*_p != '\0' && isdigit((int) *_p)) _p++;
}

/* Copy va_list before consuming with va_arg */
Expand Down
6 changes: 3 additions & 3 deletions deps/hiredis/hiredis.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ typedef long long ssize_t;
#include "alloc.h" /* for allocation wrappers */

#define HIREDIS_MAJOR 1
#define HIREDIS_MINOR 1
#define HIREDIS_PATCH 1
#define HIREDIS_SONAME 1.1.1-dev
#define HIREDIS_MINOR 2
#define HIREDIS_PATCH 0
#define HIREDIS_SONAME 1.1.0

/* Connection type can be blocking or non-blocking and is set in the
* least significant bit of the flags field in redisContext. */
Expand Down
1 change: 1 addition & 0 deletions deps/hiredis/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ int redisContextSetTcpUserTimeout(redisContext *c, unsigned int timeout) {
res = setsockopt(c->fd, IPPROTO_TCP, TCP_USER_TIMEOUT, &timeout, sizeof(timeout));
#else
res = -1;
errno = ENOTSUP;
(void)timeout;
#endif
if (res == -1) {
Expand Down
10 changes: 5 additions & 5 deletions deps/hiredis/sds.c
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@ hisds *hi_sdssplitargs(const char *line, int *argc) {
*argc = 0;
while(1) {
/* skip blanks */
while(*p && isspace(*p)) p++;
while(*p && isspace((int) *p)) p++;
if (*p) {
/* get a token */
int inq=0; /* set to 1 if we are in "quotes" */
Expand All @@ -959,8 +959,8 @@ hisds *hi_sdssplitargs(const char *line, int *argc) {
while(!done) {
if (inq) {
if (*p == '\\' && *(p+1) == 'x' &&
isxdigit(*(p+2)) &&
isxdigit(*(p+3)))
isxdigit((int) *(p+2)) &&
isxdigit((int) *(p+3)))
{
unsigned char byte;

Expand All @@ -984,7 +984,7 @@ hisds *hi_sdssplitargs(const char *line, int *argc) {
} else if (*p == '"') {
/* closing quote must be followed by a space or
* nothing at all. */
if (*(p+1) && !isspace(*(p+1))) goto err;
if (*(p+1) && !isspace((int) *(p+1))) goto err;
done=1;
} else if (!*p) {
/* unterminated quotes */
Expand All @@ -999,7 +999,7 @@ hisds *hi_sdssplitargs(const char *line, int *argc) {
} else if (*p == '\'') {
/* closing quote must be followed by a space or
* nothing at all. */
if (*(p+1) && !isspace(*(p+1))) goto err;
if (*(p+1) && !isspace((int) *(p+1))) goto err;
done=1;
} else if (!*p) {
/* unterminated quotes */
Expand Down
20 changes: 17 additions & 3 deletions deps/hiredis/ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@
#include "async_private.h"
#include "hiredis_ssl.h"

#define OPENSSL_1_1_0 0x10100000L

void __redisSetError(redisContext *c, int type, const char *str);

struct redisSSLContext {
Expand Down Expand Up @@ -100,7 +102,7 @@ redisContextFuncs redisContextSSLFuncs;
* Note that this is only required for OpenSSL < 1.1.0.
*/

#if OPENSSL_VERSION_NUMBER < 0x10100000L
#if OPENSSL_VERSION_NUMBER < OPENSSL_1_1_0
#define HIREDIS_USE_CRYPTO_LOCKS
#endif

Expand Down Expand Up @@ -256,13 +258,25 @@ redisSSLContext *redisCreateSSLContextWithOptions(redisSSLOptions *options, redi
if (ctx == NULL)
goto error;

ctx->ssl_ctx = SSL_CTX_new(SSLv23_client_method());
const SSL_METHOD *ssl_method;
#if OPENSSL_VERSION_NUMBER >= OPENSSL_1_1_0
ssl_method = TLS_client_method();
#else
ssl_method = SSLv23_client_method();
#endif

ctx->ssl_ctx = SSL_CTX_new(ssl_method);
if (!ctx->ssl_ctx) {
if (error) *error = REDIS_SSL_CTX_CREATE_FAILED;
goto error;
}

SSL_CTX_set_options(ctx->ssl_ctx, SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3);
#if OPENSSL_VERSION_NUMBER >= OPENSSL_1_1_0
SSL_CTX_set_min_proto_version(ctx->ssl_ctx, TLS1_2_VERSION);
#else
SSL_CTX_set_options(ctx->ssl_ctx, SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3 | SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_1);
#endif

SSL_CTX_set_verify(ctx->ssl_ctx, options->verify_mode, NULL);

if ((cert_filename != NULL && private_key_filename == NULL) ||
Expand Down
16 changes: 14 additions & 2 deletions deps/hiredis/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ static int tests = 0, fails = 0, skips = 0;

static void millisleep(int ms)
{
#if _MSC_VER
#ifdef _MSC_VER
Sleep(ms);
#else
usleep(ms*1000);
Expand Down Expand Up @@ -409,10 +409,19 @@ static void test_tcp_options(struct config cfg) {
redisContext *c;

c = do_connect(cfg);

test("We can enable TCP_KEEPALIVE: ");
test_cond(redisEnableKeepAlive(c) == REDIS_OK);

disconnect(c, 0);
#ifdef TCP_USER_TIMEOUT
test("We can set TCP_USER_TIMEOUT: ");
test_cond(redisSetTcpUserTimeout(c, 100) == REDIS_OK);
#else
test("Setting TCP_USER_TIMEOUT errors when unsupported: ");
test_cond(redisSetTcpUserTimeout(c, 100) == REDIS_ERR && c->err == REDIS_ERR_IO);
#endif

redisFree(c);
}

static void test_reply_reader(void) {
Expand Down Expand Up @@ -1567,6 +1576,9 @@ static void test_throughput(struct config config) {
// }

#ifdef HIREDIS_TEST_ASYNC

#pragma GCC diagnostic ignored "-Woverlength-strings" /* required on gcc 4.8.x due to assert statements */

struct event_base *base;

typedef struct TestState {
Expand Down
3 changes: 1 addition & 2 deletions deps/lua/src/lua_cjson.c
Original file line number Diff line number Diff line change
Expand Up @@ -464,9 +464,8 @@ static void json_encode_exception(lua_State *l, json_config_t *cfg, strbuf_t *js
static void json_append_string(lua_State *l, strbuf_t *json, int lindex)
{
const char *escstr;
int i;
const char *str;
size_t len;
size_t i, len;

str = lua_tolstring(l, lindex, &len);

Expand Down
3 changes: 1 addition & 2 deletions deps/lua/src/strbuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,7 @@ void strbuf_resize(strbuf_t *s, size_t len)

void strbuf_append_string(strbuf_t *s, const char *str)
{
int i;
size_t space;
size_t i, space;

space = strbuf_empty_length(s);

Expand Down
13 changes: 11 additions & 2 deletions src/acl.c
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ void ACLSelectorRemoveCommandRule(aclSelector *selector, sds new_rule) {
* as well if the command is removed. */
char *rule_end = strchr(existing_rule, ' ');
if (!rule_end) {
/* This is the last rule, so it it to the end of the string. */
/* This is the last rule, so move it to the end of the string. */
rule_end = existing_rule + strlen(existing_rule);

/* This approach can leave a trailing space if the last rule is removed,
Expand All @@ -580,6 +580,8 @@ void ACLSelectorRemoveCommandRule(aclSelector *selector, sds new_rule) {
/* Copy the remaining rules starting at the next rule to replace the rule to be
* deleted, including the terminating NULL character. */
memmove(copy_position, copy_end, strlen(copy_end) + 1);
existing_rule = copy_position;
continue;
}
}
existing_rule = copy_end;
Expand Down Expand Up @@ -1859,6 +1861,12 @@ int ACLCheckAllPerm(client *c, int *idxptr) {
/* Check if the user's existing pub/sub clients violate the ACL pub/sub
* permissions specified via the upcoming argument, and kill them if so. */
void ACLKillPubsubClientsIfNeeded(user *new, user *original) {
/* Do nothing if there are no subscribers. */
if (!dictSize(server.pubsub_patterns) &&
!dictSize(server.pubsub_channels) &&
!dictSize(server.pubsubshard_channels))
return;

listIter li, lpi;
listNode *ln, *lpn;
robj *o;
Expand Down Expand Up @@ -1990,7 +1998,8 @@ sds *ACLMergeSelectorArguments(sds *argv, int argc, int *merged_argc, int *inval
for (int j = 0; j < argc; j++) {
char *op = argv[j];

if (op[0] == '(' && op[sdslen(op) - 1] != ')') {
if (open_bracket_start == -1 &&
(op[0] == '(' && op[sdslen(op) - 1] != ')')) {
selector = sdsdup(argv[j]);
open_bracket_start = j;
continue;
Expand Down

0 comments on commit 2962227

Please sign in to comment.