-
Notifications
You must be signed in to change notification settings - Fork 409
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
Expose default_transaction_...
Postgres settings
#8276
Conversation
This exposes the `default_transaction_isolation`, `default_transaction_deferrable` and `default_transaction_read_only` (as `default_transaction_access_mode`) settings.
UPDATE: most examples in the second-half (original comment) of this comment are NOT how this PR behaves; the
(original comment)
Postgres facts:
Intermediate conclusions:
The Gel complication:
Complication examples:
|
We don't want |
@elprans I pushed a few commits according to our recent PM discussion; I still don't feel this is right - like the fact that the actual access mode for implicit ReadOnly transactions is still ReadWrite underneath violates the description of
Meanwhile, explicit transactions (if they're set to read-only because of |
Did you resolve these concerns out-of-band or are they still outstanding? |
@@ -489,7 +489,7 @@ def scan_check_ctes( | |||
name='flag', val=pgast.BooleanConstant(val=True) | |||
)], | |||
relation=pgast.RelRangeVar(relation=pgast.Relation( | |||
schemaname='edgedb', name='_dml_dummy')), | |||
name='_dml_dummy')), |
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.
Do you think we should try to invalidate the persistent cache because of this change, or should we just instruct affected users to clear the cache manually?
(This is a more general question about miscompilation bugs and the persistent cache that I'm not sure we've ever properly figured out)
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.
Oh true! One way that might work is to always "upgrade" the persistent cache automatically after server upgrade (by recompiling the cached queries) even if there are no compiler changes - if it's already in downtime maintenance, why not make the most of it and make sure the query cache is up to date. Let me draft a PR for that.
should we just instruct affected users to clear the cache manually?
I'd use that as the last resort when we failed to make the server fix itself (which is likely the case now, but let me fix that).
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.
Is extending the downtime (possibly by a lot) better than a cache flush? It's not totally obvious to me.
Maybe it would be best to come up with an empty cache and then repopulate in the background?
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 don't consider cache recompilation to be a release blocker, by the way; it's been an outstanding issue through all of 5.0, so we can live with it a little longer.
(Fixing it is still good, though; but lower priority than getting this PR finalized and landed)
Yeah, I just talked to Elvis; the use case of deferrables is mostly seen in explicit transactions, so this consistency is okay for now. I'll also double check that the cache persistence works okay. |
The |
Setting it on the system/database level is kind of marginal anyway, though, since |
* `default_transaction_*` settings apply to implicit transactions * `start transaction` will take transaction modifiers from the `default_transaction_*` settings, unless explicitly specified * When the effective `default_transaction_isolation` is lower than `Serializable`, the effective `default_transaction_access_mode` will always be `ReadOnly` * Read-only implicit transactions are currently emulated in the Gel server to avoid internal complications * `default_transaction_isolation` currently doesn't work on system/ database level
* `default_transaction_*` settings apply to implicit transactions * `start transaction` will take transaction modifiers from the `default_transaction_*` settings, unless explicitly specified * When the effective `default_transaction_isolation` is lower than `Serializable`, the effective `default_transaction_access_mode` will always be `ReadOnly` * Read-only implicit transactions are currently emulated in the Gel server to avoid internal complications * `default_transaction_isolation` currently doesn't work on system/ database level Co-authored-by: Elvis Pranskevichus <[email protected]>
* `default_transaction_*` settings apply to implicit transactions * `start transaction` will take transaction modifiers from the `default_transaction_*` settings, unless explicitly specified * When the effective `default_transaction_isolation` is lower than `Serializable`, the effective `default_transaction_access_mode` will always be `ReadOnly` * Read-only implicit transactions are currently emulated in the Gel server to avoid internal complications * `default_transaction_isolation` currently doesn't work on system/ database level
This exposes the
default_transaction_isolation
,default_transaction_deferrable
anddefault_transaction_read_only
(asdefault_transaction_access_mode
) settings.TODO:
default_transaction_isolation := ReadCommitted
also makes the transaction read-only;SET
command (possibly by issuing a correspondingSET transaction_XXX =
)._inject_config_cache_clear
fails in a read-only transaction (andconfig set
should work there)issue:(nvm, this isconfigure system set default_transaction_isolation
followed by areset
doesn't fall back to connection defaultserializable
inEDGEDB_SERVER_SETTINGS
, instead it becomes PG defaultread committed
.\psql
not applying the connection params)sys::get_transaction_isolation()
reports the wrong level ifdefault_transaction_isolation
is set on system/database level (because "postgres client" tier is higher than "postgres database" or "configuration file")