heroku / heroku/heroku-buildpack-ruby

Heroku CI: Support building rails 6 with multiple databases on multiple nodes

Open
#1,209 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Ruby
Stars
785
Forks
1.8k
Avg merge
1d 9h
Merged PRs (30d)
8

Description

We have multiple postgres databases (in different clouds in production) that we want to test against with Heroku CI with multiple nodes.

- Our primary database is set to use `heroku-postgresql:in-dyno` which works fine.
- A second database is running as `heroku-postgresql:standard-0`, and during `db:structure:load_if_sql` in the buildpack, whichever node arrives first loads the structure, and all later nodes spew ERRORs about the structure already existing.
+ On occassion, two nodes attempt to apply migrations simultaneously, causing one of them to error out the build with a `ActiveRecord::ConcurrentMigrationError` 😞.
+ Even with transactional tests, we sometimes fail tests that count database records. This seems like a bug elsewhere, but being able to provision a second in-dyno database (another db in the same postgresql server even) would solve this problem.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the buildpack's db:structure:load_if_sql step and trace how Heroku CI nodes provision and initialize the second PostgreSQL database. Reproduce the multiple-node setup described here, then define completion as database initialization and migrations succeeding without concurrent-node errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql, rails, ruby
Domain
ci-cd, databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.