]> git.saurik.com Git - redis.git/blobdiff - src/redis.c
Sentinel: Redis-side support for slave priority.
[redis.git] / src / redis.c
index 12b623e793f8f5918f15736fac1ef913c10e6635..fb6624eb402918f6e2c6af26c56515b84bd53ebb 100644 (file)
@@ -1137,6 +1137,7 @@ void initServerConfig() {
     server.repl_serve_stale_data = 1;
     server.repl_slave_ro = 1;
     server.repl_down_since = time(NULL);
+    server.slave_priority = REDIS_DEFAULT_SLAVE_PRIORITY;
 
     /* Client output buffer limits */
     server.client_obuf_limits[REDIS_CLIENT_LIMIT_CLASS_NORMAL].hard_limit_bytes = 0;
@@ -2045,6 +2046,8 @@ sds genRedisInfoString(char *section) {
                     "master_link_down_since_seconds:%ld\r\n",
                     (long)server.unixtime-server.repl_down_since);
             }
+            info = sdscatprintf(info,
+                "slave_priority:%d\r\n", server.slave_priority);
         }
         info = sdscatprintf(info,
             "connected_slaves:%lu\r\n",