after reading the optimistic concurrency docs, I would like to understand which is the best way to handle the following scenario:
- client fetches two "related" documents
- client does its biz logic, changing both
- client tries to update the documents: the first one is correctly updated on ES, the second one for some reason gives error and it is not updated
- ES is left in an inconsistent state, i.e. the first doc is post-biz logic, the second one is pre-biz logic.
This is a "transaction"-like scenario, and ES does not support transactions. But.... how would you manage this? Which is the most robust way to manage such errors? (saving to a temporary index/temporary _ids? adding a flag to mark incomplete docs? ...)