What is the best way to detect inconsistency between elasticsearch with another authorized data store


Our system uses dynamoDB as the data store and sync the data to elasticsearch with kafka.

In case there are any data loss due to the failure of any part of the system, we would have inconsistency between dynamo and elasticsearch. In order to detect this situation, what would be the best recommended way to do it?