stripe / pg-schema-diff

Go library for diffing Postgres schemas and generating SQL migrations
MIT License
316 stars 23 forks source link

Implement retry system #143

Open bplunkett-stripe opened 1 month ago

bplunkett-stripe commented 1 month ago

Even some fast-running migration statements need to acquire a an ACCESS_EXCLUSIVE_LOCK to update the table metadata. Acquiring this lock can be very tricky on high throughput databases, and it may transiently fail given a strict enough lock timeout. We should:

Plan generation: Define retry specs on some statements, where clients can determine if and how they want to retry CLI: Implement a retry system that leverages the retry specs