Compare commits

...

6 Commits
2.8.0 ... 2.8.1

Author SHA1 Message Date
antirez
dd239c37db Redis 2.8.1. 2013-11-25 11:21:49 +01:00
Salvatore Sanfilippo
c61cc761d5 Merge pull request #1370 from yaauie/deprecate-redis-copy-script-2.8
Deprecate redis copy script 2.8
2013-11-25 02:10:32 -08:00
antirez
d13635b2a9 Sentinel: fixes inverted strcmp() test preventing config updates.
The result of this one-char bug was pretty serious, if the new master
had the same port of the previous master, but just a different IP
address, non-leader Sentinels would not be able to recognize the
configuration change.

This commit fixes issue #1394.

Many thanks to @shanemadden that reported the bug and helped
investigating it.
2013-11-25 10:57:20 +01:00
antirez
d240202261 Sentinel: fix type specifier for Hello msg generation.
This fixes issue #1395.
2013-11-25 10:25:10 +01:00
antirez
e83741746c Fix false positive in memory efficiency test.
Fixes issue #1298.
2013-11-25 10:21:18 +01:00
Ryan Biesemeyer
7d30b3121d Deprecate utils/redis-copy.rb in favor of redis-copy gem 2013-11-08 06:33:04 +00:00
5 changed files with 26 additions and 60 deletions

View File

@@ -14,6 +14,15 @@ 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.1 ] Release date: 25 Nov 2013
# UPGRADE URGENCY: LOW for Redis, CRITICAL for Senitnel. You don't need to
upgrade your Redis instances but it is highly recommended
to upgrade and restart all the Sentinel processes.
* [FIX] Fixed a bug in "new Sentinel" config propagation.
* [FIX] Fixed a false positive in Redis tests.
--[ Redis 2.8.0 ] Release date: 22 Nov 2013
# UPGRADE URGENCY: LOW, unless you want to upgrade to new Sentinel code.

View File

@@ -2027,7 +2027,7 @@ void sentinelReceiveHelloMessages(redisAsyncContext *c, void *reply, void *privd
if (msgmaster->config_epoch < master_config_epoch) {
msgmaster->config_epoch = master_config_epoch;
if (master_port != msgmaster->addr->port ||
!strcmp(msgmaster->addr->ip, token[5]))
strcmp(msgmaster->addr->ip, token[5]))
{
sentinelAddr *old_addr;
@@ -2080,12 +2080,12 @@ int sentinelSendHello(sentinelRedisInstance *ri) {
/* Format and send the Hello message. */
snprintf(payload,sizeof(payload),
"%s,%d,%s,%llu," /* Info about this sentinel. */
"%s,%s,%d,%lld", /* Info about current master. */
"%s,%s,%d,%llu", /* Info about current master. */
ip, server.port, server.runid,
(unsigned long long) sentinel.current_epoch,
/* --- */
master->name,master_addr->ip,master_addr->port,
master->config_epoch);
(unsigned long long) master->config_epoch);
retval = redisAsyncCommand(ri->cc,
sentinelPublishReplyCallback, NULL, "PUBLISH %s %s",
SENTINEL_HELLO_CHANNEL,payload);

View File

@@ -1 +1 @@
#define REDIS_VERSION "2.8.0"
#define REDIS_VERSION "2.8.1"

View File

@@ -22,7 +22,7 @@ start_server {tags {"memefficiency"}} {
64 0.25
128 0.35
1024 0.75
16384 0.90
16384 0.82
} {
test "Memory efficiency with values in range $size_range" {
set efficiency [test_memory_efficiency $size_range]

View File

@@ -3,66 +3,23 @@
#
# Copy the whole dataset from one Redis instance to another one
#
# WARNING: currently hashes and sorted sets are not supported! This
# program should be updated.
# WARNING: this utility is deprecated and serves as a legacy adapter
# for the more-robust redis-copy gem.
require 'rubygems'
require 'redis'
require 'digest/sha1'
require 'shellwords'
def redisCopy(opts={})
sha1=""
src = Redis.new(:host => opts[:srchost], :port => opts[:srcport])
dst = Redis.new(:host => opts[:dsthost], :port => opts[:dstport])
puts "Loading key names..."
keys = src.keys('*')
puts "Copying #{keys.length} keys..."
c = 0
keys.each{|k|
vtype = src.type?(k)
ttl = src.ttl(k).to_i if vtype != "none"
if vtype == "string"
dst[k] = src[k]
elsif vtype == "list"
list = src.lrange(k,0,-1)
if list.length == 0
# Empty list special case
dst.lpush(k,"")
dst.lpop(k)
else
list.each{|ele|
dst.rpush(k,ele)
}
end
elsif vtype == "set"
set = src.smembers(k)
if set.length == 0
# Empty set special case
dst.sadd(k,"")
dst.srem(k,"")
else
set.each{|ele|
dst.sadd(k,ele)
}
end
elsif vtype == "none"
puts "WARNING: key '#{k}' was removed in the meanwhile."
end
# Handle keys with an expire time set
if ttl != -1 and vtype != "none"
dst.expire(k,ttl)
end
c = c+1
if (c % 1000) == 0
puts "#{c}/#{keys.length} completed"
end
}
puts "DONE!"
src = "#{opts[:srchost]}:#{opts[:srcport]}"
dst = "#{opts[:dsthost]}:#{opts[:dstport]}"
`redis-copy #{src.shellescape} #{dst.shellescape}`
rescue Errno::ENOENT
$stderr.puts 'This utility requires the redis-copy executable',
'from the redis-copy gem on https://rubygems.org',
'To install it, run `gem install redis-copy`.'
exit 1
end
$stderr.puts "This utility is deprecated. Use the redis-copy gem instead."
if ARGV.length != 4
puts "Usage: redis-copy.rb <srchost> <srcport> <dsthost> <dstport>"
exit 1