Skip to content

Upgrade golang-migrate/migrate to v4 (#1384) #1802

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

Merged
merged 1 commit into from
Dec 6, 2019
Merged

Upgrade golang-migrate/migrate to v4 (#1384) #1802

merged 1 commit into from
Dec 6, 2019

Conversation

adnxn
Copy link
Contributor

@adnxn adnxn commented Nov 8, 2019

What this PR does:
changes mattes/migrate path to golang-migrate/migrate, upgrades to v4.7.0, and corresponding changes to migrate api use in pkg/configs/db/postgres/postgres.go

ran go mod vendor and go mod tidy

Which issue(s) this PR fixes:
Fixes #1384

@adnxn adnxn marked this pull request as ready for review November 10, 2019 17:53
@gouthamve gouthamve requested review from bboreham and jtlisi November 11, 2019 09:56
Copy link
Contributor

@jtlisi jtlisi left a comment

Choose a reason for hiding this comment

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

I have one minor nit, otherwise this looks good to me. Have you tested it locally?

}
return DB{}, errors.New("database migrations failed")
level.Warn(util.Logger).Log("msg", "no change in schema, error (ignored)", "error", err)
Copy link
Contributor

@jtlisi jtlisi Nov 15, 2019

Choose a reason for hiding this comment

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

Should this be a warn level log? It looks like it should be a debug level log since it is expected behavior?

Signed-off-by: adnan <adnan.khan021@gmail.com>
Copy link
Contributor

@jtlisi jtlisi left a comment

Choose a reason for hiding this comment

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

LGTM

@gouthamve gouthamve merged commit fcbc186 into cortexproject:master Dec 6, 2019
@bboreham
Copy link
Contributor

bboreham commented Dec 6, 2019

Crashes immediately on startup for me, with -target configs:

no scheme
database migrations initialization failed
github.com/cortexproject/cortex/pkg/configs/db/postgres.New
	/go/src/github.com/cortexproject/cortex/pkg/configs/db/postgres/postgres.go:80
github.com/cortexproject/cortex/pkg/configs/db.New
	/go/src/github.com/cortexproject/cortex/pkg/configs/db/db.go:88
github.com/cortexproject/cortex/pkg/cortex.(*Cortex).initConfigs
	/go/src/github.com/cortexproject/cortex/pkg/cortex/modules.go:378
github.com/cortexproject/cortex/pkg/cortex.(*Cortex).initModule
	/go/src/github.com/cortexproject/cortex/pkg/cortex/cortex.go:232
github.com/cortexproject/cortex/pkg/cortex.(*Cortex).init
	/go/src/github.com/cortexproject/cortex/pkg/cortex/cortex.go:226
github.com/cortexproject/cortex/pkg/cortex.New
	/go/src/github.com/cortexproject/cortex/pkg/cortex/cortex.go:179
main.main
	/go/src/github.com/cortexproject/cortex/cmd/cortex/main.go:73
runtime.main
	/usr/local/go/src/runtime/proc.go:203
runtime.goexit
	/usr/local/go/src/runtime/asm_amd64.s:1357
error initialising module: configs
github.com/cortexproject/cortex/pkg/cortex.(*Cortex).initModule
	/go/src/github.com/cortexproject/cortex/pkg/cortex/cortex.go:233
github.com/cortexproject/cortex/pkg/cortex.(*Cortex).init
	/go/src/github.com/cortexproject/cortex/pkg/cortex/cortex.go:226
github.com/cortexproject/cortex/pkg/cortex.New
	/go/src/github.com/cortexproject/cortex/pkg/cortex/cortex.go:179
main.main
	/go/src/github.com/cortexproject/cortex/cmd/cortex/main.go:73
runtime.main
	/usr/local/go/src/runtime/proc.go:203
runtime.goexit
	/usr/local/go/src/runtime/asm_amd64.s:1357

@bboreham
Copy link
Contributor

I got another crash today which could be related: #1972

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.

github.com/mattes/migrate has moved, please use gopkg.in/golang-migrate/migrate.v1
4 participants