频繁出现409, version conflict

Elasticsearch | 作者 godma | 发布于5 天前 | 阅读数:48

bulk upsert操作日志中,频繁出现409,类似 current version[2] is different than the one provided [1]或是already exists这样, 贴两个吧,哪位老铁给个思路,感谢
```
{
"update": {
"_index": "",
"_type": "test",
"_id": "188656244",
"error": {
"reason": "[test][188656244]: version conflict, current version [3] is different than the one provided [2]",
"index_uuid": "7B0eai0wQa-xiulTFkkKRw",
"index": "",
"shard": "3",
"type": "version_conflict_engine_exception"
},
"status": 409
}
}
```
```

{
"update": {
"_index": "",
"_type": "test",
"_id": "188658596",
"error": {
"reason": "[test][188658596]: version conflict, document already exists (current version [1])",
"index_uuid": "7B0eai0wQa-xiulTFkkKRw",
"index": "",
"shard": "0",
"type": "version_conflict_engine_exception"
},
"status": 409
}
}

```
已邀请:

rochy - rochy_he@jointsky

赞同来自:

看起来是你在写入的时候加入了版本号,这样可以保证数据更改的一致性;
就是说你在写入之前,数据已经被别人修改过了,这样你再去覆盖写入是不合理的。
所以个人觉得你目前的 409 要从业务上来考虑当版本冲突时怎么处理

要回复问题请先登录注册