Healthcheck settings are ignored for connections to the database in Postgres sink
A note for the community
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
Problem
I noticed that setting healthcheck.enabled to false doesn't prevent vector from exiting with an error if the endpoint specified in the endpoint doesn't exist when it starts up. That is, if vector starts up earlier than postgres, it will exit with an error regardless of the healthcheck.enabled setting.
Configuration
sources:
stdin:
type: stdin
sinks:
postgres:
type: postgres
table: test
endpoint: "psql://127.0.0.1:9000" # invalid when vector starts
healthcheck:
enabled: false # the important bit
inputs:
- stdin
Version
0.47.0
Debug Output
Example Data
No response
Additional Context
No response
References
https://github.com/vectordotdev/vector/pull/21248#issuecomment-2910373131
@jorgehermo9 created the issue here
Responding to https://github.com/vectordotdev/vector/pull/21248#issuecomment-2910373131:
When the healthcheck is disabled, we want to be as permissive as possible assuming the environment will recover later, so ideally we would start the Vector instance when the healthcheck is disabled.
I think the fix would be very easy, just replace connect with connect_lazy in sqlx's Pool https://docs.rs/sqlx/latest/sqlx/struct.Pool.html#method.connect_lazy
I can submit a PR with this change (and tests)
Working on this! fighting with tests mostly 😄