I am attempting to validate some reindex from remote operations
I am reindexing from a "source" cluster to a "destination" cluster
for an index "IndexName" I run the following
r = esDest.reindex(body=query, wait_for_completion=True)
then I compare
es.cat.count(index = [indexName], h=['count'])
between the source cluster and destination cluster
The value of the source cluster will be 1234, while the value from the destination will be 0.
However if I call time.sleep(123456) for some period of time depending on the size of the index, before I do the comparison, the value from the destination will be 1234, which passes the test as I have defined it.
Why is this happening and how can I intelligently decide how long to wait?