Concurrent delete_by_query and indexing

sorry for confusing definitions. id doesn't mean Elastic's _id. it's possible to have few docs in ES with the same id.

In my application I want ES is to be in sync with DB, I have sync function for this. sync is being run in queue, and after sync(my_id) cal doc may change state from needs to be indexed to needs to be deleted.

my_id represents one object in application, but may be represented by a few objects in ES. The cheapest way to perform sync of such domain is to index all docs we can find in db by my_id, and delete all old docs matching my_id criteria.

That means, if the document changes between the time when the snapshot was taken and when the delete request is processed, you get a version conflict.

What is the best practice to deal with such conflict? Perform deletion, if there are failed docs wait and perform one more?