Evangelos Malandrakis
11/11/2024, 12:12 PM500 internal server error
when using the requests
library in Python to hit the /api/v1/layout/workspaces/:workspace_id/logicalModel
endpoint. The trace ID for this is 3b3ad7ae-1228484
.
Weirdly, when I run the exact same request in Postman, it takes a while but eventually succeeds. This difference is causing issues on our end since our deployment process relies on this API working smoothly.
Could this be related to the issue mentioned here? https://gooddataconnect.slack.com/archives/C04S1MSLEAW/p1730391356547959?thread_ts=1730103507.185409&cid=C04S1MSLEAW
Thanks in advance!Branislav Slávik
11/12/2024, 5:06 PMEvangelos Malandrakis
11/12/2024, 6:02 PMBranislav Slávik
11/13/2024, 1:51 PMorg.postgresql.util.PSQLException: ERROR: canceling statement due to conflict with recovery
Detail: User query might have needed to see row versions that must be removed.
I found the following explanation of when such issue(s) usually happen:
This error will occur when the standby server gets updates/deletes in the WAL stream that will invalidate data currently being accessed by a running query.
You will primary see this with long-running queries accessing tables with significant activity on the primary.as well as:
Some old row versions were removed byand:on the primary server, but these row versions could still be required by the query on the standby. So there is a conflict between the running query and the startup process applying changes that come from the primary.VACUUM
Running queries on hot-standby server is somewhat tricky — it can fail, because during querying some needed rows might be updated or deleted on primary. As a primary does not know that a query is started on secondary it thinks it can clean up (vacuum) old versions of its rows. Then secondary has to replay this cleanup, and has to forcibly cancel all queries which can use these rows.Based on the above, I would say that this might be some sort of a "race condition" that could have happened at the time. Moreover so since you mentioned you were doing some deployments. I am glad the issue is not persistent and you were able to get a successful response. With that in mind, I hope that it won't occur again with your next deployment(s). If by any chance it does, please let us know and we can dig in deeper to your deployment procedure, etc. in order to investigate this further.
Evangelos Malandrakis
11/14/2024, 10:01 AM