Skip to content
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

Deadlock between search requests and ingestion process #311

Open
drnextgis opened this issue Oct 14, 2024 · 0 comments
Open

Deadlock between search requests and ingestion process #311

drnextgis opened this issue Oct 14, 2024 · 0 comments

Comments

@drnextgis
Copy link
Collaborator

We are encountering numerous errors when using stac-fastapi-pgstac for POST /search requests, such as the following:

DETAIL:  Process 20810 waits for AccessShareLock on relation 18359 of database 16399; blocked by process 600.
Process 600 waits for AccessExclusiveLock on relation 152918537 of database 16399; blocked by process 20810.
HINT:  See server log for query details.

In this instance, 18359 refers to the partition_steps materialized view, and 152918537 refers to the _items_491914_202410 (item partition). It seems likely that this issue is caused by an ongoing ingestion process (using pypgstac) during the search, which triggers a table lock on the mentioned partition. I'm curious about how the partition_steps view might be impacted by the ingestion and what strategies can mitigate this issue. Could the update_partition_stats_q function be contributing to the problem? For context: the usage queue is enabled, but perhaps the frequency at which it is triggered needs adjustment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant