Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

postgres: Make ensureVersionTable atomic #150

Merged
merged 13 commits into from
Jan 15, 2019

Conversation

tsenart
Copy link
Contributor

@tsenart tsenart commented Jan 11, 2019

Fixes #55. Superseeds #149.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 268

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 59.188%

Totals Coverage Status
Change from base Build 264: 0.0%
Covered Lines: 773
Relevant Lines: 1306

💛 - Coveralls

@coveralls
Copy link

coveralls commented Jan 11, 2019

Pull Request Test Coverage Report for Build 283

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 59.188%

Totals Coverage Status
Change from base Build 279: 0.0%
Covered Lines: 773
Relevant Lines: 1306

💛 - Coveralls

@tsenart tsenart closed this Jan 11, 2019
@tsenart tsenart reopened this Jan 11, 2019
@tsenart
Copy link
Contributor Author

tsenart commented Jan 11, 2019

Closed and reopened to trigger CI again which had a flake in the previous run.

Copy link
Member

@dhui dhui left a comment

Choose a reason for hiding this comment

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

Thanks for investigating and fixing!

I think this approach is fine for now. Specifically, for postgres, we don't need to worry about the lock stomping over itself since we're using session level advisory locks which are reentrant.

There's the larger issue where all driver operations should be atomic for all drivers. Locks may not be reentrant for other db drivers. I'll create a separate issue for this.

database/postgres/postgres_test.go Outdated Show resolved Hide resolved
database/postgres/postgres.go Outdated Show resolved Hide resolved
@tsenart
Copy link
Contributor Author

tsenart commented Jan 12, 2019

@dhui: Please take another look!

Copy link
Member

@dhui dhui left a comment

Choose a reason for hiding this comment

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

Thanks for addressing the feedback!

database/postgres/postgres.go Outdated Show resolved Hide resolved
database/postgres/postgres.go Outdated Show resolved Hide resolved
@tsenart tsenart force-pushed the atomic-migrations-table-creation branch from 4793961 to 8323c1c Compare January 13, 2019 11:47
@tsenart
Copy link
Contributor Author

tsenart commented Jan 13, 2019

@dhui: Please take another look :-)

database/postgres/postgres.go Outdated Show resolved Hide resolved
@tsenart tsenart force-pushed the atomic-migrations-table-creation branch from a112283 to 41a595f Compare January 15, 2019 10:29
@tsenart
Copy link
Contributor Author

tsenart commented Jan 15, 2019

@dhui: I added the dependency manually to Gopkg.toml but that didn't seem to work. Running dep ensure -add github.com/hashicorp/go-multierror@v1.0.0 leads to errors: https://gist.github.com/tsenart/bad59caf9a41e55ea8347c43d2c11719

Not sure how to proceed. Please help :-)

    - Updates Gopkg.lock after github.com/hashicorp/go-multierror package was manually added to Gopkg.toml
@dhui
Copy link
Member

dhui commented Jan 15, 2019

Thanks for adding the dependency via dep.

I added the dependency manually to Gopkg.toml

I pushed a new commit that updates Gopkg.lock to your repo branch. Once tests pass, I'll merge.

@dhui dhui merged commit f6d624c into golang-migrate:master Jan 15, 2019
@dhui
Copy link
Member

dhui commented Jan 15, 2019

Will cut a new release in ~1 week

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.

None yet

3 participants