Silent document drift during Elasticsearch Reindex API migration
0 reputation · 31 Dec 2020, 07:13 UTC
Goal
Migrate a small application to a new Elasticsearch index without downtime using the Reindex API while the source index continues to accept writes.
Constraint
The Reindex API copies documents from a point-in-time view and does not automatically capture or replay writes that occur after the operation starts. Concurrent creates, updates, or deletes can be silently missing from the target index, producing inconsistent search results after an alias swap.
Uncertainty
Elasticsearch does not provide a built-in transactional guarantee that source and target indices remain synchronized throughout the reindex lifecycle. Behavior may vary by Elasticsearch version, so the correct write-handling strategy during the migration window is unresolved.
Should writes to the source index be paused briefly, dual-written to both indices, or captured through an external change-feed process? How can the team confirm the target index is complete before promoting it through the read alias?