Commit f6d5996e authored by antirez's avatar antirez
Browse files

Merge branch 'unstable' of github.com:/antirez/redis into unstable

parents 3ef59b50 aca7f36b
...@@ -134,7 +134,7 @@ int _dictInit(dict *d, dictType *type, ...@@ -134,7 +134,7 @@ int _dictInit(dict *d, dictType *type,
* but with the invariant of a USED/BUCKETS ratio near to <= 1 */ * but with the invariant of a USED/BUCKETS ratio near to <= 1 */
int dictResize(dict *d) int dictResize(dict *d)
{ {
int minimal; unsigned long minimal;
if (!dict_can_resize || dictIsRehashing(d)) return DICT_ERR; if (!dict_can_resize || dictIsRehashing(d)) return DICT_ERR;
minimal = d->ht[0].used; minimal = d->ht[0].used;
......
...@@ -2754,11 +2754,16 @@ void replicationCacheMasterUsingMyself(void) { ...@@ -2754,11 +2754,16 @@ void replicationCacheMasterUsingMyself(void) {
server.master_repl_offset, server.master_repl_offset,
delta); delta);
server.master_initial_offset = server.master_repl_meaningful_offset; server.master_initial_offset = server.master_repl_meaningful_offset;
server.repl_backlog_histlen -= delta; server.master_repl_offset = server.master_repl_meaningful_offset;
server.repl_backlog_idx = if (server.repl_backlog_histlen <= delta) {
(server.repl_backlog_idx + (server.repl_backlog_size - delta)) % server.repl_backlog_histlen = 0;
server.repl_backlog_size; server.repl_backlog_idx = 0;
if (server.repl_backlog_histlen < 0) server.repl_backlog_histlen = 0; } else {
server.repl_backlog_histlen -= delta;
server.repl_backlog_idx =
(server.repl_backlog_idx + (server.repl_backlog_size - delta)) %
server.repl_backlog_size;
}
} }
/* The master client we create can be set to any DBID, because /* The master client we create can be set to any DBID, because
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment