无论才能、知识多么卓著,如果缺乏热情,则无异纸上画饼充饥,无补于事。

请问Elasticsearch 批量更新的时候反复提示同一个id的文档冲突,应该怎么办

默认分类 | 作者 chaochao6411 | 发布于2019年04月03日 | 阅读数:4269

 Error in Matomo: {took:18,timed_out:false,total:1,updated:0,deleted:0,batches:1,version_conflicts:1,noops:0,retries:{bulk:0,search:0},throttled_millis:0,requests_per_second:-1.0,throttled_until_millis:0,failures:[{index:matomo_es:matomo_option,type:matomo_option,id:2zsa3WkBEhkV7KlGL4t7,cause:{type:version_conflict_engine_exception,reason:[matomo_option][2zsa3WkBEhkV7KlGL4t7]: version conflict, current version [5] is different than the one provided [4],index_uuid:lmTuHsp1ThK6crFdWPtafw,shard:1,index:matomo_es:matomo_option},status:409}]}
[02-Apr-2019 09:29:00 UTC] 
 
 
Error in Matomo: {took:6,timed_out:false,total:1,updated:0,deleted:0,batches:1,version_conflicts:1,noops:0,retries:{bulk:0,search:0},throttled_millis:0,requests_per_second:-1.0,throttled_until_millis:0,failures:[{index:matomo_es:matomo_option,type:matomo_option,id:2zsa3WkBEhkV7KlGL4t7,cause:{type:version_conflict_engine_exception,reason:[matomo_option][2zsa3WkBEhkV7KlGL4t7]: version conflict, current version [6] is different than the one provided [5],index_uuid:lmTuHsp1ThK6crFdWPtafw,shard:1,index:matomo_es:matomo_option},status:409}]}
[03-Apr-2019 00:33:35 UTC]
 
 
 Error in Matomo: {took:9,timed_out:false,total:1,updated:0,deleted:0,batches:1,version_conflicts:1,noops:0,retries:{bulk:0,search:0},throttled_millis:0,requests_per_second:-1.0,throttled_until_millis:0,failures:[{index:matomo_es:matomo_option,type:matomo_option,id:2zsa3WkBEhkV7KlGL4t7,cause:{type:version_conflict_engine_exception,reason:[matomo_option][2zsa3WkBEhkV7KlGL4t7]: version conflict, current version [12] is different than the one provided [11],index_uuid:lmTuHsp1ThK6crFdWPtafw,shard:1,index:matomo_es:matomo_option},status:409}]}
[03-Apr-2019 01:11:29 UTC] 
 
 
从昨天就开始报错,今天还是同一个id的文档冲突,下面是代码的截图。
QQ截图20190403092756.png
已邀请:

Fisher - 鱼仔

赞同来自:

说明你这个批量操作里有多个对统一文档的修改 导致的更新冲突
看能不能根据根据业务顺序  在提交批量更新请求前  对更新进行进行一次去重合并
将同一id的更新合并成一条再提交

laoyang360 - 《一本书讲透Elasticsearch》作者,Elastic认证工程师 [死磕Elasitcsearch]知识星球地址:http://t.cn/RmwM3N9;微信公众号:铭毅天下; 博客:https://elastic.blog.csdn.net

赞同来自:

conflit=proceed了解下 专门处理冲突的

要回复问题请先登录注册