Skip to content

[BUG] Changing port is not reflected in cluster slot #13892

@raz-mon

Description

@raz-mon

Describe the bug

Upon updating/setting the port of an existing node, the CLUSTER SLOTS command still shows the previous port.
tcp_port is not updated for the node in which the change occurred only, i.e., the rest of the nodes in the cluster are updated about the change.

To reproduce

First, lift a Redis cluster. Then, follow the following scenario:

  502 47542     1   0  5:11PM ??         0:00.10 /usr/local/bin/redis-server *:30001 [cluster]                            
  502 47544     1   0  5:11PM ??         0:00.10 /usr/local/bin/redis-server *:30002 [cluster]                            
  502 47546     1   0  5:11PM ??         0:00.09 /usr/local/bin/redis-server *:30003 [cluster]                            
  502 47548     1   0  5:11PM ??         0:00.09 /usr/local/bin/redis-server *:30004 [cluster]                            
  502 47550     1   0  5:11PM ??         0:00.09 /usr/local/bin/redis-server *:30005 [cluster]                            
  502 47552     1   0  5:11PM ??         0:00.09 /usr/local/bin/redis-server *:30006 [cluster]                            
  502 47620 25933   0  5:11PM ttys040    0:00.00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn --exclude-dir=.idea --exclude-dir=.tox --exclude-dir=.venv --exclude-dir=venv redis-server
 ➜  redis-cli -p 30001
127.0.0.1:30001> CONFIG GET port
1) "port"
2) "30001"
127.0.0.1:30001> CONFIG SET port 30000
OK
127.0.0.1:30001> 
➜ redis-cli -p 30000
127.0.0.1:30000> cluster slots
1) 1) (integer) 0
   2) (integer) 5460
   3) 1) "127.0.0.1"
      2) (integer) 30001
      3) "2eb39a4c10793456a87d1e4cde3c4759abae1216"
      4) (empty array)
   4) 1) "127.0.0.1"
      2) (integer) 30006
      3) "fae3a233401dd347dcea3d16041021faca0c7269"
      4) (empty array)
2) 1) (integer) 5461
   2) (integer) 10922
   3) 1) "127.0.0.1"
      2) (integer) 30002
      3) "f084dd09f761efa8a268afb81efb63ca8a81feb4"
      4) (empty array)
   4) 1) "127.0.0.1"
      2) (integer) 30004
      3) "9978ddbb5d1c0a62e96bbb1bcbf4176d76585e61"
      4) (empty array)
3) 1) (integer) 10923
   2) (integer) 16383
   3) 1) "127.0.0.1"
      2) (integer) 30003
      3) "c80c64bb6ccfe841e5b8e6f1e8c32b4b75e50997"
      4) (empty array)
   4) 1) "127.0.0.1"
      2) (integer) 30005
      3) "206474a924420719cf4b097771ad10e7d266cfab"
      4) (empty array)

The other nodes are aware of the change:

➜ redis-cli -p 30002
127.0.0.1:30002> cluster slots
1) 1) (integer) 0
   2) (integer) 5460
   3) 1) "127.0.0.1"
      2) (integer) 30000
      3) "2eb39a4c10793456a87d1e4cde3c4759abae1216"
      4) (empty array)
   4) 1) "127.0.0.1"
      2) (integer) 30006
      3) "fae3a233401dd347dcea3d16041021faca0c7269"
      4) (empty array)
2) 1) (integer) 5461
   2) (integer) 10922
   3) 1) "127.0.0.1"
      2) (integer) 30002
      3) "f084dd09f761efa8a268afb81efb63ca8a81feb4"
      4) (empty array)
   4) 1) "127.0.0.1"
      2) (integer) 30004
      3) "9978ddbb5d1c0a62e96bbb1bcbf4176d76585e61"
      4) (empty array)
3) 1) (integer) 10923
   2) (integer) 16383
   3) 1) "127.0.0.1"
      2) (integer) 30003
      3) "c80c64bb6ccfe841e5b8e6f1e8c32b4b75e50997"
      4) (empty array)
   4) 1) "127.0.0.1"
      2) (integer) 30005
      3) "206474a924420719cf4b097771ad10e7d266cfab"
      4) (empty array)

Expected behavior

The port should be updated for the node itself as well, otherwise the results of running CLUSTER SLOTS on it are wrong.

Additional information

I believe the situation with tls_port is similar, and probably will need the same fix as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions