Status: To Do
Affects Version/s: None
Fix Version/s: None
Our Index and Elasticsearch DAO patch operations are not atomic. Currently a patch involves looking up the current version of a document, patching it, then reindexing the whole document in separate steps. This could lead to a race condition that causes incorrect or corrupt data.
This pattern also exists in a couple different places in the ElasticsearchMetaAlertDao including here.
Elasticsearch offers an Update API that may be more appropriate in these cases. I don't know if it works on nested documents so that would need to be tested.
Looking up the whole doc as part of an update is also causing this bug in the SolrMetaAlertDao feature because Solr returns extra fields that can't be directly reindexed. There is also an Atomic Update in Solr that is similar to the Elasticsearch Update API.