elasticsearch
elasticsearch copied to clipboard
Change synonyms index auto-expand replicas to 0-1
Changes auto-expand replicas in synonyms index to 0-1
from 0-all
. This is the only system index that uses a 0-all setting, and that causes failures in CI related to #113478.
#113478 changed fast indices so now they read from search shards. This broke some CI tests, as synonyms system index is only created when accessed for the first time, and accessing it immediately afterwards did not guarantee that a search replica shard had been created yet (see elasticsearch serverless issue 2922).
The obvious solution was to wait to shards been green, which was introduced in #114400. However, this broke BwC tests in non-serverless CI.
The reason is the index cannot be green in BwC tests:
- A 4 node cluster is created for BwC testing
- 2 nodes are updated to the newer version
- Synonyms test start, and create the synonym index. It should create 4 replica shards as we have 0-all auto-expand setting.
- In case a node in a newer version is used, it creates the shard but it cannot be replicated to the older nodes, as they are using an index and node version that is less than the updated one
- Index can't be green as 2 shards can be replicated to the new nodes, but 2 cannot.
This change should fix the above problem when backported to 8.x, and is a prerequirement to unmute synonyms tests (see issues #114432, #114443, #114444). Once this is merged, we can fix the CI tests by waiting for a green index status, as 1 replica will be able to be created (1 primary and 1 replica corresponding to the two nodes updated to the new version).
I can't think of a simple change in tests that would fix this (as we have non-bwc and bwc tests involved, which have different number of nodes), and this would align synonyms system index replica settings with the rest of the system indices.