You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[TEST] wait for all active shards when indexing data (#122163)
This attempts to fix a flay test where the term_freq returned
by the multiple terms vectors API was `null`.
I was not able to reproduce this test but this proposes a fix
based on the following running theory:
- an Elasticsearch cluster comprised of at least 2 nodes
- we create a couple of indices with 1 primary and 1 replica
- we index a document that was acknowledged only by the primary
(because `wait_for_active_shards` defaults to `1`)
- the test executes the multiple terms vectors API and it hits the
node hosting the replica shard, which hasn't yet received the
document we ingested in the primary shard.
This race condition between the document replication and the test
running the terms vectors API on the replica shard could yield
a `null` value for the the term's `term_freq` (as the replica shard
contains 0 documents).
This PR proposes we change the `wait_for_active_shards` value to
`all` so each write is acknowledged by all replicas before the client
receives the response.
(cherry picked from commit a148fa2)
Signed-off-by: Andrei Dan <[email protected]>
0 commit comments