Advanced Search: MigrationWorker sometimes picks the wrong migration
Currently in our sidekiq logs we have:
MigrationWorker: migration[ApplyMaxAnalyzedOffset] did not execute migrate method since it was already executed. Waiting for migration to complete
MigrationWorker: migration[ApplyMaxAnalyzedOffset] updating with completed: false
which means that Elastic::MigrationWorker
returns an obsolete ApplyMaxAnalyzedOffset
migration as current migration. That breaks the migration logic. We should find the problem and fix it since it effectively halted all migrations.
Additional details
[ gprd ] production> Elastic::MigrationRecord.load_versions(completed: false)
=> [20210825110300, 20201105181100]
Edited by Dmitry Gruzd