Add backwards compatibility patch for 2.x config files

Resolves Red Hat BZ #1491728.
This commit is contained in:
Nathan Scott 2017-09-27 08:46:16 +10:00
parent d36789d62d
commit 6d845630d5
2 changed files with 52 additions and 1 deletions

View File

@ -0,0 +1,48 @@
From 2ef9dcc1ae28ace8966621a69c7a9342bde3c183 Mon Sep 17 00:00:00 2001
From: Nathan Scott <nathans@redhat.com>
Date: Tue, 26 Sep 2017 14:42:56 +1000
Subject: [PATCH 3/3] backward compatibility for 2.x series config file options
---
src/config.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/src/config.c b/src/config.c
index c1919f2..3bd4374 100644
--- a/src/config.c
+++ b/src/config.c
@@ -451,6 +451,10 @@ void loadServerConfigFromString(char *config) {
server.hash_max_ziplist_entries = memtoll(argv[1], NULL);
} else if (!strcasecmp(argv[0],"hash-max-ziplist-value") && argc == 2) {
server.hash_max_ziplist_value = memtoll(argv[1], NULL);
+ } else if (!strcasecmp(argv[0],"hash-max-zipmap-entries") && argc == 2) {
+ /* DEAD OPTION */
+ } else if (!strcasecmp(argv[0],"hash-max-zipmap-value") && argc == 2) {
+ /* DEAD OPTION */
} else if (!strcasecmp(argv[0],"list-max-ziplist-entries") && argc == 2){
/* DEAD OPTION */
} else if (!strcasecmp(argv[0],"list-max-ziplist-value") && argc == 2) {
@@ -619,6 +623,20 @@ void loadServerConfigFromString(char *config) {
err = sentinelHandleConfiguration(argv+1,argc-1);
if (err) goto loaderr;
}
+ } else if (!strcasecmp(argv[0],"vm-enabled") && argc == 2) {
+ /* DEAD OPTION */
+ } else if (!strcasecmp(argv[0],"really-use-vm") && argc == 2) {
+ /* DEAD OPTION */
+ } else if (!strcasecmp(argv[0],"vm-swap-file") && argc == 2) {
+ /* DEAD OPTION */
+ } else if (!strcasecmp(argv[0],"vm-max-memory") && argc == 2) {
+ /* DEAD OPTION */
+ } else if (!strcasecmp(argv[0],"vm-page-size") && argc == 2) {
+ /* DEAD OPTION */
+ } else if (!strcasecmp(argv[0],"vm-pages") && argc == 2) {
+ /* DEAD OPTION */
+ } else if (!strcasecmp(argv[0],"vm-max-threads") && argc == 2) {
+ /* DEAD OPTION */
} else {
err = "Bad directive or wrong number of arguments"; goto loaderr;
}
--
2.13.5

View File

@ -41,6 +41,8 @@ Source8: %{name}-limit-init
Patch0001: 0001-1st-man-pageis-for-redis-cli-redis-benchmark-redis-c.patch
# https://github.com/antirez/redis/pull/3494 - symlink
Patch0002: 0002-install-redis-check-rdb-as-a-symlink-instead-of-dupl.patch
# Backwards compatibility for deprecated configuration file options
Patch0003: 0003-backward-compatibility-for-2.x-series-config-file-op.patch
%if 0%{?with_perftools}
BuildRequires: gperftools-devel
%else
@ -115,6 +117,7 @@ and removal, status checks, resharding, rebalancing, and other operations.
rm -frv deps/jemalloc
%patch0001 -p1
%patch0002 -p1
%patch0003 -p1
# Use system jemalloc library
sed -i -e '/cd jemalloc && /d' deps/Makefile
@ -272,7 +275,7 @@ fi
%changelog
* Tue Sep 26 2017 Nathan Scott <nathans@redhat.com> - 3.2.11-1
- Upstream 3.2.11 bug-fix-only release
- Switch to using Type=notify for Redis systemd services (RHBZ #1172841)
- Back-compatibility for deprecated configuration options (RHBZ #1491728)
- Add Provides:bundled hiredis, linenoise, lua-libs clauses (RHBZ #788500)
* Mon Aug 14 2017 Nathan Scott <nathans@redhat.com> - 3.2.10-2