Thread database_name through Migration/CompiledMigration/TimeoutPolicies - #157
Merged
Conversation
…r/TimeoutPolicies Reuses the database_name-threading mechanism from closed PR #156, excluding the unrelated remove_index concurrently: feature that caused that PR to be closed.
orlylevk
reviewed
Aug 13, 2026
orlylevk
left a comment
Contributor
There was a problem hiding this comment.
The changes looks ok
Can we add the bug fix in here CHANGELOG.md + update the minor version
BBrannick
commented
Aug 13, 2026
orlylevk
approved these changes
Aug 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Nandi::Config's per-database timeout lookup methods (access_exclusive_lock_timeout,concurrent_statement_timeout, etc.) already accepted an optionaldatabase_nameargument, but nothing in the migration-compilation pipeline ever passed one — every timeout/config lookup always resolved against the default database, even for migrations compiled against a non-default database (e.g. a YugabyteDB-configured database).database_nameend-to-end:CompiledMigration#migration→Migration.new(validator, database_name:)→Migration#database_name→disable_lock_timeout?/disable_statement_timeout?/default_statement_timeout/default_lock_timeout→TimeoutPolicies::AccessExclusive/Concurrent(viamigration.database_name).database_name: nilremains the default at every layer, so this is a fully backward-compatible change — zero behavior difference for single-database or default-database usage.master. Deliberately excludes that PR's unrelatedremove_index concurrently:feature, which is why it was closed.spec/nandi/timeout_policies/concurrent_spec.rb, which previously had zero coverage.Test plan
bundle exec rspec(433 examples, 0 failures)bundle exec rubocopreports 0 offensesMigration#database_name(default + explicit),CompiledMigration#migrationpassingdatabase_name, andTimeoutPolicies::AccessExclusive/Concurrentresolving bounds against a non-default database🤖 Generated with Claude Code