-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
feat: constrained extensions #56
Conversation
4f4ade6
to
7d79673
Compare
This is only needed for extensions and we no longer are one.
c305c9d
to
883a020
Compare
883a020
to
d2353c1
Compare
@@ -0,0 +1,231 @@ | |||
#include "utils.h" | |||
|
|||
#if PG13_GTE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've made sure this feature only works for pg 13 onwards while not breaking pg 12 compat with other features. Check 883a020 commit message for more details.
It's considerable work to do this, we should consider dropping support for pg 12 later.
case JCE_EXPECT_CPU: | ||
case JCE_EXPECT_MEM: | ||
case JCE_EXPECT_DISK: | ||
parse->error_msg = "unexpected object for cpu, mem or disk, expected a value"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested these parse errors manually. Our test suite doesn't have a way to run with different configs for now.
awesome!! great work on the tests too 👀 |
d2353c1
to
31432d2
Compare
Adds resource constraints for cpu, memory and disk for extensions. Compat with pg 12 is done by omitting constrainted extensions code using if macro directives checking the PostgreSQL version. Since all the tests are ran for all the pg versions, a variant comparison file for pg12 is used: https://www.postgresql.org/docs/current/regress-variant.html The variant test checks that all the extensions are created and that this only happens for pg 12. This way we ensure that the pg12 test output is not matched by accident for pg >= 13 and we get test failures if the constrained extensions code fails.
31432d2
to
5032162
Compare
Rendered documentation
Define a setting:
And extensions that don't comply the minimum resources will fail:
Tasks