-
Notifications
You must be signed in to change notification settings - Fork 407
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
Support closing all connections to a database on database drop #6780
Conversation
Hmm, while adding a test, I realized this was not enough. |
# The frontend connection should be closed by the server now | ||
self.assertTrue(conn.is_closed()) |
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.
Are you confident that this will be reflected in the client state already?
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.
Yeah, the test passed at b851e5c - could be flaky but I haven't met
2a07fdb
to
1686041
Compare
1686041
to
1204ead
Compare
edb/edgeql/parser/grammar/ddl.py
Outdated
_, _, name = kids | ||
self.val = qlast.DropDatabase(name=name.val) | ||
|
||
def reduce_DROP_BRANCH_RESET_CONNECTIONS_DatabaseName(self, *kids): |
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.
Not sure I like the formulation. It doesn't read very well and would scale poorly if we add more options. I actually like PostgreSQL's drop database foo [with option, ...]
somewhat more. I also like force
as a shorter spelling (a-la Postgres also)
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.
Sure
drop database
will now interrupt and close idle frontend connections before the actual backend database is dropped. Note, idle-in-transaction frontend connections will also be closed.@msullivan you can configure
close_frontend_conns=True
conditionally inexecute.pyx
.Fixes #6776