ElasticSearch Conflict Error on place order (Magento 2)

We have started to see an interesting issue recently. Sometimes when an order is placed, Magento throws the following exception, which causes Vue Storefront believe the order failed to be placed. However this exception happens after the order has been created, so customers are then attempting to place the order multiple times.

"failures": [
        {
            "index": "vue_storefront_catalog_en_eu_1582821702",
            "type": "product",
            "id": "38",
            "cause": {
                "type": "version_conflict_engine_exception",
                "reason": "[product][38]: version conflict, current version [1790] is different than the one provided [1789]",
                "index_uuid": "GjBqge-KRoWFREzBFuYZiA",
                "shard": "2",
                "index": "vue_storefront_catalog_en_eu_1582821702"
            },
            "status": 409
        }
    ]

Unfortunately we haven’t been able to find a way to consistently reproduce the issue, but we have been able to reproduce it at least a few times. It is always this same conflict error. I’m assuming this is happening while magento2-vsbridge-indexer is trying to update the product(s) in ElasticSearch, probably the stock data would be my guess.

What I have found, it seems like this is an issue of ElasticSearch being updated multiple times too quickly so the reference is outdated. I have seen recommendations to add parameters to the update request like ?conflicts=proceed&refresh=wait_for. However, as this is going through the VSBridge module, I haven’t been able to locate a place to add these parameters, or any way to figure out a way around this error.

Any thoughts, suggestions, recommendations would be greatly appreciated!

Definitely, it sounds like indexer-related problem. You should create as detailed as a possible issue on it’s repo: https://github.com/DivanteLtd/magento2-vsbridge-indexer