(1)_version元数据

PUT /test_index/test_type/6
{
“test_field”: “test test”
}

{
“_index”: “test_index”,
“_type”: “test_type”,
“_id”: “6”,
“_version”: 1,
“result”: “created”,
“_shards”: {
“total”: 2,
“successful”: 1,
“failed”: 0
},
“created”: true
}
Elasticsearch内部如何基于_version进行乐观锁并发控制
第一次创建一个document的时候,它的_version内部版本号就是1;以后,每次对这个document执行修改或者删除操作,都会对这个_version版本号自动加1;哪怕是删除,也会对这条数据的版本号加1

{
“found”: true,
“_index”: “test_index”,
“_type”: “test_type”,
“_id”: “6”,
“_version”: 4,
“result”: “deleted”,
“_shards”: {
“total”: 2,
“successful”: 1,
“failed”: 0
}
}
Elasticsearch内部如何基于_version进行乐观锁并发控制
Elasticsearch内部如何基于_version进行乐观锁并发控制

相关文章:

  • 2022-12-23
  • 2021-10-07
  • 2021-12-31
  • 2022-01-13
  • 2021-12-17
  • 2021-10-19
  • 2022-01-14
猜你喜欢
  • 2022-03-07
  • 2021-05-30
  • 2021-05-19
  • 2022-12-23
  • 2021-11-12
  • 2021-06-26
  • 2022-12-23
相关资源
相似解决方案