-
Notifications
You must be signed in to change notification settings - Fork 3.9k
sql: support asyncpg #83026
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
Comments
A very simple test case that reproduces the MARS issue is as follows:
Interestingly, I think the root cause might actually be that |
Here's a more minimal example:
If the cursor is properly drained, no error is returned. This makes me think that it's likely that asyncpg errors that we see in the wild are more likely caused by improperly closed cursors than true multiple-active-cursor support being required... |
One very interesting thing we could do, assuming that people "abandoning old cursors" is the common case (and that we aren't expecting people to actually be interleaving cursors), is the following diff (possibly gated behind a session flag?). This does cause the test cases above to work, but I haven't played around with what else it would break.
|
Another very interesting thing: asyncpg doesn't even expect that it's possible to run multiple active cursors, even though Postgres does actually permit it based on the protocol. This says to me that any MARS activity generated by asyncpg programs is actually not expected, and we should solve it by explicitly closing any open cursors on the asyncpg side when moving to the next operation. it's possible that the linked issue is only about true concurrency rather than interleaved cursors, but I don't really think that the library is expecting people to interleave cursors either. |
Perhaps you want to test those cases using PostgreSQL. We are using Do you have an ETA for this issue? |
Uh oh!
There was an error while loading. Please reload this page.
This is a tracking issue for supporting
asyncpg
.MOVE
is expected to be able to interact with pgwire-level portals. It currently does not, which results in errors likecursor "__asyncpg_portal_3__" does not exist
when trying to use the asyncpg APIcursor.forward
.Jira issue: CRDB-16803
The text was updated successfully, but these errors were encountered: