Skip to content
This repository was archived by the owner on Dec 12, 2025. It is now read-only.

Conversation

@maxgio92
Copy link
Contributor

@maxgio92 maxgio92 commented Feb 11, 2022

This PR tries to fix #889 by not to not try to access non-declared split horizon DNS records.

The issue occurs during scaling down, as the automation config is tried to be built with actual numbers of replicas with desired split-horizon dns records. Then a panic with out of range on the related slice is triggered.

Closes #889

Signed-off-by: maxgio92 massimiliano.giovagnoli.1992@gmail.com

…rizon dns records

The issue occurs during scaling down, as the automation config is tried to be built with actual numbers of replicas with desired split-horizon dns records. Then a panic with out of range of the related slice is triggered.

Signed-off-by: maxgio92 <massimiliano.giovagnoli.1992@gmail.com>
@maxgio92 maxgio92 force-pushed the fix/scale-down-automation-config branch from 27ef4c7 to 2fd3877 Compare February 11, 2022 12:36
Copy link
Contributor

@priyolahiri priyolahiri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to add a log entry if the horizon entries are being ignored because of wrong entries or blank config?

@priyolahiri
Copy link
Contributor

Also, please check #851 (comment) to ensure that this case is covered as well

Signed-off-by: maxgio92 <massimiliano.giovagnoli.1992@gmail.com>
@maxgio92
Copy link
Contributor Author

maxgio92 commented Feb 17, 2022

Hello @priyolahiri, thank you for your time. I added a second test case for multiple DNS horizons.

About the logging, I noticed that the builder structures leveraged to build the automation config doesn't accept a logger as of now. I'd avoid to extend those structures, as in the end, this state is transitionary during the reconciliation and when the reconciliation will be completed no nil horizon record will be.

Otherwise we can think about extending those structures to accept loggers as done in other packages.

What do you think?

@priyolahiri
Copy link
Contributor

Hello @priyolahiri, thank you for your time. I added a second test case for multiple DNS horizons.

About the logging, I noticed that the builder structures leveraged to build the automation config doesn't accept a logger as of now. I'd avoid to extend those structures, as in the end, this state is transitionary during the reconciliation and when the reconciliation will be completed no nil horizon record will be.

Otherwise we can think about extending those structures to accept loggers as done in other packages.

What do you think?

We can work with this for now. Let's thick about extending later.

@priyolahiri priyolahiri merged commit d94c20a into mongodb:master Feb 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Controller panic on downscale

2 participants