kevinight
kevinight3d ago

What is the SQL statements that require Postgres Advisory Lock

hi, could anyone help point what are the SQL statements that require Postgres Advisory Lock, which cause the following error:
jemalloc enabled
Connecting to database...
{"timestamp":"2025-05-27T17:02:29.786757Z","level":"INFO","message":"Could not remove sqlx migration with version=20250131115248: error returned from database: relation \"_sqlx_migrations\" does not exist","target":"windmill_api::db"}
{"timestamp":"2025-05-27T17:02:29.790508Z","level":"INFO","message":"Could not remove sqlx migration with version=20250201145632: error returned from database: relation \"_sqlx_migrations\" does not exist","target":"windmill_api::db"}
{"timestamp":"2025-05-27T17:02:29.794294Z","level":"INFO","message":"Could not remove sqlx migration with version=[20250201145630, 20250201145631] : error returned from database: relation \"_sqlx_migrations\" does not exist","target":"windmill_api::db"}
{"timestamp":"2025-05-27T17:02:29.800722Z","level":"INFO","message":"Acquiring global PG lock for potential migration with pid: Some(14391)","target":"windmill_api::db"}
{"timestamp":"2025-05-27T17:02:29.808052Z","level":"ERROR","message":"Error acquiring lock: error returned from database: advisory locks are not yet implemented","target":"windmill_api::db"}
Error: Error migrating db: Migrating database: while executing migrations: error returned from database: advisory locks are not yet implemented
jemalloc enabled
Connecting to database...
{"timestamp":"2025-05-27T17:02:29.786757Z","level":"INFO","message":"Could not remove sqlx migration with version=20250131115248: error returned from database: relation \"_sqlx_migrations\" does not exist","target":"windmill_api::db"}
{"timestamp":"2025-05-27T17:02:29.790508Z","level":"INFO","message":"Could not remove sqlx migration with version=20250201145632: error returned from database: relation \"_sqlx_migrations\" does not exist","target":"windmill_api::db"}
{"timestamp":"2025-05-27T17:02:29.794294Z","level":"INFO","message":"Could not remove sqlx migration with version=[20250201145630, 20250201145631] : error returned from database: relation \"_sqlx_migrations\" does not exist","target":"windmill_api::db"}
{"timestamp":"2025-05-27T17:02:29.800722Z","level":"INFO","message":"Acquiring global PG lock for potential migration with pid: Some(14391)","target":"windmill_api::db"}
{"timestamp":"2025-05-27T17:02:29.808052Z","level":"ERROR","message":"Error acquiring lock: error returned from database: advisory locks are not yet implemented","target":"windmill_api::db"}
Error: Error migrating db: Migrating database: while executing migrations: error returned from database: advisory locks are not yet implemented
thanks in advance!
8 Replies
rubenf
rubenf3d ago
all our migrations logic require advisory locks
kevinight
kevinightOP3d ago
thanks for your quick reply, can i check out the statements that require advisory locks, would this and this be the places where advisory lock is used? it would be helpful to resolve this issue, thanks!
GitHub
windmill/backend/windmill-api/src/db.rs at af9bde33fe89188b51e35028...
Open-source developer platform to power your entire infra and turn scripts into webhooks, workflows and UIs. Fastest workflow engine (13x vs Airflow). Open-source alternative to Retool and Temporal...
rubenf
rubenf3d ago
what db are you using?
kevinight
kevinightOP3d ago
Yugabyte
rubenf
rubenf3d ago
probably not the best fit for windmill anyway
kevinight
kevinightOP3d ago
they added the advisory lock support, their engineer is trying to debug on this from user's perspective, why it's not a good fit, is there anything i should be aware of? i just start using WindMill and we use Yugabyte as main db
rubenf
rubenf3d ago
windmill is write heavy, those managed postgresql are usually read optimized
kevinight
kevinightOP3d ago
got it, thanks for the info!

Did you find this page helpful?