Refactor ClusterReindexingService and remove migrations related cases
What does this MR do and why?
Summary
This change introduces a feature flag (elasticsearch_migrations_type_class) to gradually roll out a cleaner, more generic way of handling the Elasticsearch migrations index during reindexing operations.
Before: The migrations index had special-case logic scattered throughout the codebase — it was handled differently from all other indices with hardcoded checks and conditions specific to it.
After: The migrations index configuration is refactored into a proper, standardized structure (new Types::MigrationsIndexConfig and References::MigrationsIndexConfig classes) that follows the same patterns used by other indices. The old MigrationsIndexConfig class is kept as a compatibility wrapper that delegates to the new classes when the feature flag is on.
Key improvements when the flag is enabled:
- Readiness checks are now generic — any index type can declare a
ready?method, and the system will automatically respect it, rather than needing custom code for each case. - Replica count lookup uses a general database query instead of a hardcoded special case for the migrations index.
- Error messages for unready indices are generated generically, with a backward-compatible message preserved for the migrations index specifically.
The feature flag allows teams to test and gradually enable the new behavior without disrupting existing functionality, and the old code paths remain fully intact as a fallback.
References
Screenshots or screen recordings
| Before | After |
|---|---|
How to set up and validate locally
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #601950 (closed)