-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Drop() does not work after https://github.com/golang-migrate/migrate/pull/150 #164
Comments
Can you provide the full test code? Are you running |
No. @dhui Okay I'll provide the reproducible code ASAP. |
I'm experiencing this issue, seeing:
I'm running on a clean Postgresql instance running inside Kubernetes via Minikube, deployed from Helm. |
It seems to happen in postgres.go line 328 if err := p.ensureVersionTable(); err != nil { Maybe some lock is not released previously or it might happen inside ensureVersionTable entirely. Edit: Well it's not ensureVersionTable itself, as it's called earlier in WithInstance, so it must happen in Edit2: Happens because |
My guess would be that the Lock is acquired in migrate.go: Lines 304 to 312 in f6d624c
In the subsequent call to Drop, the database is still locked so when we call ensureVersionTable and it tries to lock the database it dies: migrate/database/postgres/postgres.go Lines 328 to 330 in f6d624c
Edit: better links |
Describe the Bug
I'm using migrate as lib. Drop() after initializing migrate instance does not work anymore.
Steps to Reproduce
Steps to reproduce the behavior:
Expected Behavior
Before 4.2.3, Drop() was always work.
Migrate Version
e.g. v4.2.3
Obtained by running my unit test program that using migrate as lib.
Loaded Source Drivers
N/A
Loaded Database Drivers
postgres
Go Version
go version go1.11.1 linux/amd64
Stacktrace
The text was updated successfully, but these errors were encountered: