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

Async migrations #950

Open
iNikem opened this issue Feb 13, 2015 · 31 comments
Open

Async migrations #950

iNikem opened this issue Feb 13, 2015 · 31 comments

Comments

@iNikem
Copy link

iNikem commented Feb 13, 2015

Some migrations can effectively be run totally asynchronously relatively to other migrations. E.g. creating of index. It would be very nice to have a possibility to mark some migrations as async and not to block the whole process on them.

@axelfontaine
Copy link
Contributor

I agree this can be valuable. It is not an immediate priority, but let's keep this open and see if it gathers traction.

Cheers
Axel

@anirudha13
Copy link

+1 for asynchronous migrations. We are using flyway with phoenix and some of our index creations take quite a long time.

@axelfontaine axelfontaine added this to the Flyway 5.2.0 milestone Nov 26, 2017
@cpoole
Copy link

cpoole commented Oct 22, 2018

some of our migrations can take upwards of 24 hours for back-filling massive tables. Would be great if these long migrations didn't block future migrations

@f1xmAn
Copy link

f1xmAn commented Feb 14, 2019

Agree, that's valuable feature for us too.

@codersbrew
Copy link

Please implement :)

@aayushbhasin
Copy link

Would be an extremely useful feature.

@evanye
Copy link

evanye commented Sep 16, 2019

+1

@ileshko
Copy link

ileshko commented Sep 16, 2019

+1!!

@codeyq
Copy link

codeyq commented Sep 17, 2019

+1!

@kakuism
Copy link

kakuism commented Feb 19, 2020

+1

@juliahayward juliahayward modified the milestones: Flyway 6.x, Flyway 7.x Feb 25, 2020
@gvdenbro
Copy link

+1

@octavian-nita
Copy link

+1

Imagine that we might use Flyway's mechanisms to trigger the update of other, non/No-SQL repos such as ElasticSearch or even to send messages to various messaging/streaming infrastructures such as Kafka.

While Java migrations help a great deal since we can implement pretty much whatever we want (including spawning async jobs), native Flyway support would make things a breeze.

And... elaborating on this topic... I'm pretty much starting to see Flyway as a generic update mechanism and not only an SQL-related one. I am not sure whether this idea sprung before but a more decoupled, "update engine"-like mechanism would be great, imho.

@MikielAgutu MikielAgutu modified the milestones: Flyway 7.x, On the Radar Sep 30, 2020
@MikielAgutu
Copy link

@octavian-nita

And... elaborating on this topic... I'm pretty much starting to see Flyway as a generic update mechanism and not only an SQL-related one. I am not sure whether this idea sprung before but a more decoupled, "update engine"-like mechanism would be great, imho.

In Flyway 7 we shipped a new feature that will help with that: https://flywaydb.org/documentation/migrations#script-migrations

@detec
Copy link

detec commented Feb 5, 2021

+1

2 similar comments
@sriram-au
Copy link

+1

@mackec1
Copy link

mackec1 commented Feb 2, 2022

+1

@christrotteradhoc
Copy link

+1

2 similar comments
@silvertonsg
Copy link

+1

@malumatos
Copy link

+1

@Jojoooo1
Copy link

  • 1

@dpolivaev
Copy link

+1

3 similar comments
@rajeshhereforyou
Copy link

+1

@spark59
Copy link

spark59 commented Dec 22, 2022

+1

@kantselovich
Copy link

+1

@EarthCitizen
Copy link

We ran into an issue in which our containers were failing health checks due to index creations taking too long. Async migration tasks are absolutely essential for embedded Spring Boot start-up migration.

@aprabhat
Copy link

@EarthCitizen I ran into same issue of POD getting restarted. Have you found any workaround for this?

@EarthCitizen
Copy link

@aprabhat In our case, they were index creations, and we created our Flyway scripts with "if not exists" for the indexes. Therefore, once they were created on the DB, the DB continued to work on them after the connection was lost when the container was restarted, and the scripts were marked as complete on the reboot due to the indexes already existing on the DB.

Basically, we got lucky.

@EarthCitizen
Copy link

I agree this can be valuable. It is not an immediate priority, but let's keep this open and see if it gathers traction.

@axelfontaine This issue appears to have traction. There is a clear community need expressed here.

@aprabhat
Copy link

aprabhat commented Jun 22, 2023

@aprabhat In our case, they were index creations, and we created our Flyway scripts with "if not exists" for the indexes. Therefore, once they were created on the DB, the DB continued to work on them after the connection was lost when the container was restarted, and the scripts were marked as complete on the reboot due to the indexes already existing on the DB.

Basically, we got lucky.

@EarthCitizen
I appreciate your response. In my case, I require the addition of a column. To achieve this, I implemented a workaround by creating a stored procedure that checks whether the column already exists. If the POD is terminated before successfully recording the entry in the schema version table, the subsequent POD will execute the same script. If the new column has already been created, the stored procedure will skip the "add column" step, and the new POD will successfully record the entry in the schema version table.

This workaround suffices for now, but it would be highly beneficial if Flyway provided an asynchronous migration feature.

@tomekrojek
Copy link

+1

1 similar comment
@Siddharth-Srinivas
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests