You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When performing re-indexing with our-evolution-scripts we have to be sure that no write-access happens while reindexing (because we write to the index-alias, which still points to the old index) Only after successful re-indexing we change the alias to new new index. Now it is save to start writing again.
To accomplish this we have added a functionality for our multi-instance environment that stops all writing on all instances before executing the evolution, and starts it again after the evolution has been completed. The schema evolutinon is triggered on application start.
But we have to do this even if no evolution will be performed because all scripts have been run already. It would be great to be able to detect if any migration is necessary - and if so perform some action, or just do nothing.
Proposal
I've seen that the current MigrationServiceImpl has a getPendingScriptsToBeExecuted Method that could help here
The most simple solution would be to expose a migrationsRequired method that returns true or false by checking the result of getPendingScriptsToBeExecuted
If you accept the general idea and the implementation proposal, I would be happy to provide a PR for this :)
The text was updated successfully, but these errors were encountered:
Why ?
When performing re-indexing with our-evolution-scripts we have to be sure that no write-access happens while reindexing (because we write to the index-alias, which still points to the old index) Only after successful re-indexing we change the alias to new new index. Now it is save to start writing again.
To accomplish this we have added a functionality for our multi-instance environment that stops all writing on all instances before executing the evolution, and starts it again after the evolution has been completed. The schema evolutinon is triggered on application start.
But we have to do this even if no evolution will be performed because all scripts have been run already. It would be great to be able to detect if any migration is necessary - and if so perform some action, or just do nothing.
Proposal
I've seen that the current MigrationServiceImpl has a
getPendingScriptsToBeExecuted
Method that could help hereelasticsearch-evolution/elasticsearch-evolution-core/src/main/java/com/senacor/elasticsearch/evolution/core/internal/migration/execution/MigrationServiceImpl.java
Line 182 in 5173314
The most simple solution would be to expose a
migrationsRequired
method that returnstrue
orfalse
by checking the result ofgetPendingScriptsToBeExecuted
If you accept the general idea and the implementation proposal, I would be happy to provide a PR for this :)
The text was updated successfully, but these errors were encountered: