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

fix(migrations) stop depending on the order as recorded #2869

Merged
merged 1 commit into from
Sep 8, 2017

Conversation

Tieske
Copy link
Member

@Tieske Tieske commented Sep 7, 2017

Migrations are recorded in the datastore and then the order in which
they appear there is relevant for determining if they should run.
Once something goes out-of-sync on every start/restart it will keep
running migrations over and over again.

Migrations are recorded in the datastore and then the order in which
they appear there is relevant for determining if they should run.
Once something goes out-of-sync on every start/restart it will keep
running migrations over and over again.
@thibaultcha
Copy link
Member

Once something goes out-of-sync

Do we have a minimal reproducible example for that?

The current migrations are already quite brittle, but this changes makes it even more brittle if anything. Things get even trickier with inter-dependent migrations (we have a lot of those). I am really curious as to why migrations would get out-of-sync in the first place and/or why a migration should be removed (or not inserted) in the recorded migrations table?

@ksachdeva11
Copy link

How can I apply the patch ? I have installed kong using sudo dpkg -i kong-community-edition-0.11.1.*.deb

@Tieske
Copy link
Member Author

Tieske commented Oct 30, 2017

@ksachdeva11 see https://patch-diff.githubusercontent.com/raw/Kong/kong/pull/2869.patch

If you don't know how to work with patches, edit the files manually, since the changes are small.

@ksachdeva11
Copy link

@Tieske can you provide the path for spec/02-integration/03-dao/02-migrations_spec.lua

I can't find it under /usr/local/share/lua/5.1/kong/

@Tieske
Copy link
Member Author

Tieske commented Oct 30, 2017

that is only the test. You do not need it when running Kong.

@jkumar-roambee
Copy link

same error on kong 0.14.1

2019/08/05 10:18:56 [verbose] running datastore migrations
2019/08/05 10:18:56 [info] migrating core for keyspace kong
Error:
/usr/local/share/lua/5.1/kong/cmd/migrations.lua:37: [cassandra error] Error during migration 2015-01-12-175310_init_schema: [Invalid] Undefined column name request_host
stack traceback:
[C]: in function 'assert'
/usr/local/share/lua/5.1/kong/cmd/migrations.lua:37: in function 'cmd_exec'
/usr/local/share/lua/5.1/kong/cmd/init.lua:87: in function </usr/local/share/lua/5.1/kong/cmd/init.lua:87>
[C]: in function 'xpcall'
/usr/local/share/lua/5.1/kong/cmd/init.lua:87: in function </usr/local/share/lua/5.1/kong/cmd/init.lua:44>
/usr/local/bin/kong:7: in function 'file_gen'
init_worker_by_lua:48: in function <init_worker_by_lua:46>
[C]: in function 'xpcall'
init_worker_by_lua:55: in function <init_worker_by_lua:53>
bash-4.3# kong version
0.14.1

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.

4 participants