question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

deadlock with metadata apply and running subscriptions

See original GitHub issue

This was seen by a user (Howard Wang#8417 Discord) in v1.3.2 when applying metadata:

2020-10-20 18:31:42 UTC:172.17.5.63(54744):t5br6hpuBHCetN33jJczdXRvTwfFXjBpANW5@hasura:[4585]: DETAIL: Process 4585 waits for AccessExclusiveLock on relation 17646 of database 16396; blocked by process 458.

Process 458 waits for AccessShareLock on relation 17824 of database 16396; blocked by process 4585.

Process 4585: DROP FUNCTION IF EXISTS hdb_views.“notify_hasura_channel_post_created_INSERT”() CASCADE

Process 458: SELECT “_subs”.“result_id” , “_fld_resp”.“root” AS “result” FROM UNNEST(($1)::uuid[], ($2)::json[]) AS…

This is causing hasura metadata apply command to fail and hence rollback of the desired upgrade.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:16 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
tirumaraiselvancommented, Nov 2, 2020

@markerdmann First thanks for working with us on this issue. We have found why DROP FUNCTION was being called needlessly and it turned out to be a CLI issue: https://github.com/hasura/graphql-engine/issues/6115

We will fix this ASAP in v1.3.3

1reaction
tirumaraiselvancommented, Nov 1, 2020

I initially assumed it was related to Subscriptions because of this Issue title, but I tested it locally and those long-running queries still appear when I cut off Subscriptions. I’ll do some further investigation tomorrow to see if I can find the exact GQL that’s connected to those long-running queries.

Subscription queries look like SELECT "_subs"."result_id" ... whereas SELECT coalesce(json_agg("root"), '[]) ... are regular queries. If you have the spreadsheet saved from before, then just directly copying that query and running against your prod DB would be safe.

Thanks for sending the migrations/metadata, we will continue investigating what might be causing DROP FUNCTION to be executed in the first place.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Deadlock and schema modification lock - Microsoft Q&A
I have a deadlock that I need some input for ... <metadatalock subresource="PERMISSIONS" classid="class = 0, major_id = 0" dbid="5" id="lock708d967580" ...
Read more >
Deadlock in "metadata_cache" table cause the system having ...
Issue simulation: I tried to create multiple "meta_hash_base" records in metadata_cache table. After I login to the system using a new browser instance,...
Read more >
How to replicate a SCH_S, SCH_M deadlock - Stack Overflow
The session already holds a SCH-M metadata lock on a user defined type (probably as you created it earlier in the script) and...
Read more >
How to report on SQL Server deadlock occurrences
Now, we will need to use collected data in order to build a graph with deadlock occurrences over time. After a little word...
Read more >
Deadlocks | Mastering MariaDB - Packt Subscription
Some combinations of locks create a situation where some transactions block each other. Since all the involved transactions are waiting for a lock...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found