Skip to content

Conversation

@hwware
Copy link
Contributor

@hwware hwware commented Jul 15, 2021

There is a bug that is mentioned in issue 8786 #8786.

The issue is that when a sentinel with the same address and IP is turned on with a different runid, its port is set to 0 but it is still present in the dictionary master->sentinels which contain all the sentinels for a master. This causes a problem when we do INFO SENTINEL because it takes the size of the dictionary of sentinels. This might also cause a problem for failover if enough sentinels have their port set to 0 since the number of voters in failover is also determined by the size of the dictionary of sentinels.

We suggest that we should remove the sentinels with the port set to zero from the dictionary of sentinels.

hwware added 3 commits July 15, 2021 11:34
Deleting sentinel with port 0 from the dictionary of sentinels.
Formatting changes
@yossigo
Copy link
Collaborator

yossigo commented Jul 18, 2021

@hwware Looks like a valid fix, but I wonder if we may also want to have a test for it - perhaps as part of the effort done in #8891? What do you think?

@hwware
Copy link
Contributor Author

hwware commented Jul 26, 2021

@yossigo, I have added a test case for this fix, please have a look. Thanks.

@yossigo yossigo merged commit db41536 into redis:unstable Jul 29, 2021
@yossigo
Copy link
Collaborator

yossigo commented Jul 29, 2021

Merged, thanks @hwware!

@yossigo yossigo added the release-notes indication that this issue needs to be mentioned in the release notes label Jul 29, 2021
@yossigo yossigo changed the title Issue 8786 sentinel duplication Remove duplicate zero-port sentinels. Jul 29, 2021
JackieXie168 pushed a commit to JackieXie168/redis that referenced this pull request Sep 8, 2021
The issue is that when a sentinel with the same address and IP is turned on with a different runid, its port is set to 0 but it is still present in the dictionary master->sentinels which contain all the sentinels for a master.

This causes a problem when we do INFO SENTINEL because it takes the size of the dictionary of sentinels. This might also cause a problem for failover if enough sentinels have their port set to 0 since the number of voters in failover is also determined by the size of the dictionary of sentinels.

This commits removes the sentinels with the port set to zero from the dictionary of sentinels.
Fixes redis#8786
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-notes indication that this issue needs to be mentioned in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants