Fixed Sentinel support for hostnames and dynamic IP addresses#10146
Fixed Sentinel support for hostnames and dynamic IP addresses#10146yossigo merged 1 commit intoredis:unstablefrom
Conversation
Sentinel only tries to resolve instances hostname to ip only during registration. It might be that the instance is unavailable during that time, such as leader crashed and failover took place. Yet, promoted replica must support: - Register the leader, even if fail to resolve instance hostname - Try later to resolve it, if instance is disconnected. Note that this condition also support ip-change of an instance.
a1ce654 to
d5c2f04
Compare
yossigo
left a comment
There was a problem hiding this comment.
@moticless LGTM, do you think we need to get some confirmation that this indeed solves the reported issues?
Also, ideally we should have tests that follow this test plan - but I don't see a simple, effective and portable way to actually do that other than mocking anetResolve() which might be a bit of an overkill. So I'm OK with leaving it as it is, unless another simple ideas comes up.
|
@yossigo ,
|
|
@moticless I think that being able to create tests that run beyond the scope of processes on a single instance will be useful, perhaps we can push this as part of bigger Redis Cluster efforts. As for simulating resolution errors, at least on Linux/glibc systems, I think there's another option: use the |
|
👀 We think we are running into the issue that this will fix. Given that the last 6.2 release was several months ago, what are the odds we'll see this fix in the next one? |
|
@ghollies it is already part of 7.0 RC2. I will ask to add it to release notes. Thanks. |
|
@moticless thanks for the quick response! any chance it will be backported to 6.x? or should we just wait for 7.0 to go final? |
@yossigo, please refer. Thanks. |
|
@ghollies I think it makes sense to backport it, yes. |
Sentinel tries to resolve instances hostname to IP only during registration. It might be that the instance is unavailable during that time, such as leader crashed and failover took place. Yet, promoted replica must support: - Register leader, even if it fails to resolve its hostname during failover - Try later to resolve it, if instance is disconnected. Note that this condition also support ip-change of an instance. (cherry picked from commit 79f089b)
Sentinel tries to resolve instances hostname to IP only during registration.
It might be that the instance is unavailable during that time, such as
leader crashed and failover took place. Yet, promoted replica must support:
this condition also support ip-change of an instance.
Resolves #8540, Resolves #9103
Test plan available here