Skip to content

Conversation

@smudge
Copy link
Member

@smudge smudge commented Jan 5, 2026

Previously, with_retry_loop had wrapped the "drop" & "add" operations separately. This is fine in the case of lock timeouts, as it will retry until it acquires a lock as expected.

However, if add_index experiences a statement timeout (and we have not yet exceeded the migration's wait_timeout), it would fail to retry if (on PostgreSQL, w/ the :concurrently opt) an invalid index was left behind. The operation should first remove the invalid index before attempting another add_index call, and that's what this PR addresses.

/no-platform

@smudge smudge requested review from effron and jmileham January 5, 2026 21:18
@smudge smudge force-pushed the fix-migration-lock-loop branch from 35445b9 to aa67eb5 Compare January 5, 2026 21:26
@smudge smudge force-pushed the fix-migration-lock-loop branch from aa67eb5 to 27c79b8 Compare January 5, 2026 21:27
Copy link
Contributor

@effron effron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

domainLGTM!

@smudge smudge merged commit 838c5a5 into Betterment:main Jan 5, 2026
25 checks passed
@smudge smudge deleted the fix-migration-lock-loop branch January 5, 2026 22:07
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

Successfully merging this pull request may close these issues.

2 participants