mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-29 01:44:36 -04:00
Fix noop_update_total
is not being updated when using the _bulk
(#105745)
Closes #105742
This commit is contained in:
parent
80094b2c3a
commit
9e06cbfe0c
3 changed files with 56 additions and 0 deletions
6
docs/changelog/105745.yaml
Normal file
6
docs/changelog/105745.yaml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
pr: 105745
|
||||||
|
summary: Fix `noop_update_total` is not being updated when using the `_bulk`
|
||||||
|
area: CRUD
|
||||||
|
type: bug
|
||||||
|
issues:
|
||||||
|
- 105742
|
|
@ -0,0 +1,49 @@
|
||||||
|
---
|
||||||
|
"Noop":
|
||||||
|
- skip:
|
||||||
|
version: " - 8.13.99"
|
||||||
|
reason: fixed in 8.14.0
|
||||||
|
- do:
|
||||||
|
indices.create:
|
||||||
|
index: test_1
|
||||||
|
body:
|
||||||
|
settings:
|
||||||
|
number_of_shards: 1
|
||||||
|
number_of_replicas: 0
|
||||||
|
- do:
|
||||||
|
cluster.health:
|
||||||
|
wait_for_status: green
|
||||||
|
- do:
|
||||||
|
bulk:
|
||||||
|
refresh: true
|
||||||
|
body: |
|
||||||
|
{ "create": { "_index": "test_1", "_id": "1"} }
|
||||||
|
{ "foo": "bar" }
|
||||||
|
{ "create": { "_index": "test_1", "_id": "2"} }
|
||||||
|
{ "foo": "bar" }
|
||||||
|
- do:
|
||||||
|
indices.stats: { index: test_1 }
|
||||||
|
|
||||||
|
- match: { indices.test_1.total.indexing.index_total: 2 }
|
||||||
|
- match: { indices.test_1.primaries.indexing.index_total: 2 }
|
||||||
|
- match: { indices.test_1.total.indexing.noop_update_total: 0 }
|
||||||
|
- match: { indices.test_1.primaries.indexing.noop_update_total: 0 }
|
||||||
|
|
||||||
|
- do:
|
||||||
|
bulk:
|
||||||
|
body: |
|
||||||
|
{ "update": { "_index": "test_1", "_id": "1"} }
|
||||||
|
{ "doc": { "foo": "bar" } }
|
||||||
|
{ "update": { "_index": "test_1", "_id": "2"} }
|
||||||
|
{ "doc": { "foo": "bar" } }
|
||||||
|
|
||||||
|
- match: { items.0.update.result: noop }
|
||||||
|
- match: { items.1.update.result: noop }
|
||||||
|
|
||||||
|
- do:
|
||||||
|
indices.stats: { index: test_1 }
|
||||||
|
|
||||||
|
- match: { indices.test_1.total.indexing.index_total: 2 }
|
||||||
|
- match: { indices.test_1.primaries.indexing.index_total: 2 }
|
||||||
|
- match: { indices.test_1.total.indexing.noop_update_total: 2 } # total noop == primaries noop
|
||||||
|
- match: { indices.test_1.primaries.indexing.noop_update_total: 2 }
|
|
@ -339,6 +339,7 @@ public class TransportShardBulkAction extends TransportWriteAction<BulkShardRequ
|
||||||
if (updateResult.getResponseResult() == DocWriteResponse.Result.NOOP) {
|
if (updateResult.getResponseResult() == DocWriteResponse.Result.NOOP) {
|
||||||
context.markOperationAsNoOp(updateResult.action());
|
context.markOperationAsNoOp(updateResult.action());
|
||||||
context.markAsCompleted(context.getExecutionResult());
|
context.markAsCompleted(context.getExecutionResult());
|
||||||
|
context.getPrimary().noopUpdate();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
context.setRequestToExecute(updateResult.action());
|
context.setRequestToExecute(updateResult.action());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue