Closed bowenlan-amzn closed 4 months ago
Bulk doesn't guarantee atomic ingestion of all documents it carries. There can be partial failures. Looking at partial failures of the response will also not work because rollback (deletion) of ingested doc or ingestion of failed doc is again not guaranteed. The only possible solution of this which requires a major effort would be to maintain a parent-child relationship to designate a group of docs and accordingly modify search queries and subsequent updates.
Got it. Just note down another approach — moving metadata as a field into job document. The small downside is anything in job document change will trigger the listener from Job Scheduler to reschedule the job.
Regarding this part of the logic for handling change policy
https://github.com/opensearch-project/index-management/blob/930157b7d5d22df48f2d48b07bf480f5aa3bf25c/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/ManagedIndexRunner.kt#L784-L795
I feel it's possible to combine these 2 into one bulk call, so they always fail or succeed at same time.
If only metadata update succeed, it seems possible to fall into this check and stop running
https://github.com/opensearch-project/index-management/blob/930157b7d5d22df48f2d48b07bf480f5aa3bf25c/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/ManagedIndexRunner.kt#L306-L307