-
Notifications
You must be signed in to change notification settings - Fork 402
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
Extremely long delay grabbing type info for string array (and likely other types) on CockroachDB #1158
Comments
The introspection query isn't that complex and typically runs in under a millisecond on regular Postgres. This is something you might want to raise with Cockroach Labs people. |
I also get a 7 seconds delay on each connection everytime it's opened. This is really annoying given I use a connection pool. This only happends with cockroachdb it doesn't happen with postgresql. On the other hand when using sql alchemy this problem does not occur. So I think the problem is on the side of the asyncpg library. |
I reached out to CockroachDB about this. |
@JamesHutchison could you please reach out to Cockroach DB support via our ticketing system: https://support.cockroachlabs.com/hc/en-us This way we can provide you with the best support. |
Created ticket |
@JamesHutchison - I can see the ticket has been created but we are unsure about the organization that you are using, could you please share the organization details in the existing ticket or create the ticket with the correct organization? |
Any new information on this? I still get delays everywhere in my app. |
They are aware of the issue My recommendation is to use my workaround in the meantime |
@JamesHutchison |
So apparently this issue might be related to asyncpg introspection queries: asyncpg/asyncpg/introspection.py Lines 14 to 88 in 85d7eed
Is there a way to rollback to a version without this issue until the problem is fixed? |
If you're using redis or really anything that could store the serialized result of the query, my hack works pretty well. |
@JamesHutchison |
Just save it to a file or something. Whatever (non-DB persistence you have available. |
I was having atrocious and unacceptable delays in my production environment that I wasn't seeing locally, using CockroachDB cloud. Found the cause was the introspection of types. I'm using the latest version of the CockroachDB drivers.
I wrote this hack to work around the issue. It caches the result in local memory and also caches it to redis so that new instances don't see it. You can change the key for the redis cache using an environment variable so that new versions aren't locked to old values.
If someone wants to turn it into part of the product, please be my guest. I won't have time for it. In the mean time. here's the hack that does monkey patching:
The text was updated successfully, but these errors were encountered: