Add max_retries and retry_interval to [(api_)database] conf#1129
Add max_retries and retry_interval to [(api_)database] conf#1129melwitt wants to merge 1 commit into
Conversation
|
Hi @melwitt. Thanks for your PR. I'm waiting for a openstack-k8s-operators member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
I tis not -1 it is 10 by default: Still enough to slow down startup and trigger the failure of the startup k8s probe that will trigger the kill of the pod. |
gibizer
left a comment
There was a problem hiding this comment.
Please fix the commit message, otherwise looks good to me.
gibizer
left a comment
There was a problem hiding this comment.
looks good. Thank for fixing
|
Build failed (check pipeline). Post ❌ openstack-meta-content-provider FAILURE in 4m 23s |
|
/retest |
|
recheck |
|
@melwitt: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
gibizer
left a comment
There was a problem hiding this comment.
The functional test failure is relevant. You can reproduce it via make test locally. We have some tests that are too specific about the content of the generated content. e.g.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: melwitt The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
|
||
| {{if (index . "cell_db_address")}} | ||
| [database] | ||
| max_retries = 3 |
There was a problem hiding this comment.
https://docs.openstack.org/nova/latest/configuration/config.html#api_database.max_retries
https://docs.openstack.org/nova/latest/configuration/config.html#api_database.retry_interval
so im not actully sure that relying on k8s retry is actully preferable
the defualt is 10
im not sure turing this to 3 relly helps with stablity in gerneal in ci.
i woudl suggest we increase max_reties to say 30
but lower retry_interval to 1 as your proposing
that keeps the time less the the k8s interval but should be more stable over all.
with that said gibi is right that we will need ot update
nova-operator/test/functional/nova/multicell_test.go
Lines 230 to 246 in 7ba93ca
the simple solution woul db to put this after the existing assert but we shoudl jsut add the new content to them as well so that we dont reguress this overried
There was a problem hiding this comment.
Fair point ... otherwise it would give up after only 3 seconds. I have updated to max_retries = 30.
Nova's default database connection retry settings (max_retries=10, retry_interval=10) mean nova-api can spend up to 100 seconds retrying a connection to an unavailable database. This exceeds the Kubernetes startup probe window (60 seconds), so the pod gets killed before nova finishes retrying, leading to a CrashLoopBackOff when a cell database is down. In RHOSO, Kubernetes provides its own higher-level retry mechanism by killing and recreating pods that fail to start. This is preferable to Nova retrying internally because it reports the situation clearly via CR status fields and events, and allows Kubernetes to reschedule the pod to another worker if needed. Set max_retries to 30 and retry_interval to 1 second for both [database] and [api_database] so that Nova gives up on an unreachable database more quickly and lets Kubernetes handle the recovery. Resolves: OSPRH-30130 Signed-off-by: melanie witt <melwittt@gmail.com>
Nova's default database connection retry settings (max_retries=10, retry_interval=10) mean nova-api can spend up to 100 seconds retrying a connection to an unavailable database. This exceeds the Kubernetes startup probe window (60 seconds), so the pod gets killed before nova finishes retrying, leading to a CrashLoopBackOff when a cell database is down.
In RHOSO, Kubernetes provides its own higher-level retry mechanism by killing and recreating pods that fail to start. This is preferable to Nova retrying internally because it reports the situation clearly via CR status fields and events, and allows Kubernetes to reschedule the pod to another worker if needed.
Set max_retries to 30 and retry_interval to 1 second for both [database] and [api_database] so that Nova gives up on an unreachable database more quickly and lets Kubernetes handle the recovery.
Resolves: OSPRH-30130