Skip to content

Clean up errors from key provider options parser #355

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

AndersAstrand
Copy link
Collaborator

I started this when doing other work with the options parser but never got it to PR then.

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 23.52941% with 13 lines in your changes missing coverage. Please review.

Project coverage is 80.67%. Comparing base (c6d4bc7) to head (1db9471).

❌ Your project status has failed because the head coverage (80.67%) is below the target coverage (90.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@                  Coverage Diff                  @@
##           TDE_REL_17_STABLE     #355      +/-   ##
=====================================================
+ Coverage              80.49%   80.67%   +0.18%     
=====================================================
  Files                     22       22              
  Lines                   2604     2598       -6     
  Branches                 398      395       -3     
=====================================================
  Hits                    2096     2096              
+ Misses                   430      427       -3     
+ Partials                  78       75       -3     
Components Coverage Δ
access 82.95% <ø> (ø)
catalog 88.15% <23.52%> (+0.59%) ⬆️
common 91.80% <ø> (ø)
encryption 75.47% <ø> (ø)
keyring 72.00% <ø> (ø)
src 66.74% <ø> (ø)
smgr 97.27% <ø> (ø)
transam ∅ <ø> (∅)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

ereport(ERROR,
errmsg("invalid semantic state"));
Assert(0);
ereport(ERROR, errmsg("invalid semantic state"));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Errors which cannot happen should either use elog or errmsg_internal.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

errmsg_internal isn't available in frontend iirc, so will go with elog then. Thanks!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this has to do with everything in errmsg() being exported for translation, right? I don't think we'll ever bother with that, but ofc we should follow the standard from core.

This function could only ever return JSON_SUCCESS.
In the key provider options parser. To make the intent behind the code
more obvious. Also use elog() for these errors to drive the point home.
To make the intent of the code clear without pretending we can return
something else than JSON_SUCCESS.
Add error codes and make them more coherent with other error messages.
Also add quotes around strings to make it clearer what the error
actually is.
To give the same error messages as any other json parsing issue.
Normally the values we get in here would already be valid postgres json
values however, so finding a parsing error should be rare.
@AndersAstrand AndersAstrand force-pushed the tde/clean-up-error-messages-from-options-parser branch from 1db9471 to 8be465d Compare May 23, 2025 12:53
@AndersAstrand AndersAstrand merged commit 44a10fd into percona:TDE_REL_17_STABLE May 23, 2025
28 checks passed
@AndersAstrand AndersAstrand deleted the tde/clean-up-error-messages-from-options-parser branch May 23, 2025 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants