Add missing return in vtctld-*
DSN case, and log any flag that gets ignored
#7872
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
A short-and-sweet one! I noticed we were missing a
return nil
in the case where a flag in the cluster DSN began withvtctld-
, which meant that we were both correctly sending that flag off to theVtctldClientProxy
for later parsing, but also falling through and attempting to match it against the discovery regexp (which, thankfully, would promptly fail to match). (Compare this block against the block just above where the flag begins withvtsql-
to see the difference).This PR adds in that missing return, and also logs any flag that falls through to the discovery case that does not match the regexp, so we can more easily catch (relatively harmless) issues like this if they happen in the future.
Related Issue(s)
Checklist
Deployment Notes
Impacted Areas in Vitess
Components that this PR will affect: