-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Closed
Labels
Description
Describe the bug
Coming from testing performed in #5898 on actual 3 node cluster, the searchable doc count does not match with the ingested doc count. I observed same with primary relocation behavior (backported #5344 & #5898 to test relocation behavior) as well. Cutting single issue as I believe the underlying cause is same for both.
Failover Case
To Reproduce
- Create an index with segrep enabled
curl -X PUT "http://localhost:9200/test-index" -H 'Content-Type: application/json' -d '{
"settings": {
"index": {
"number_of_shards": 1,
"number_of_replicas": 1,
"replication.type": "SEGMENT"
}
}
}'
- Ingest documents via script. Run this in multiple tabs. I used 3.
for i in {1..20000}
do
curl --location --request POST "localhost:9200/test-index/_doc" \
--header 'Content-Type: application/json' \
--data-raw "{
\"name\":\"abc${i}\"
}"
echo "\n"
done
- Verify 1 primary & 1 replica created
[root@ip-10-0-4-169 opensearch]# curl -X GET "localhost:9200/_cat/shards?v"
index shard prirep state docs store ip node
test-index 0 p STARTED 0 208b 10.0.5.122 ip-10-0-5-122.us-west-2.compute.internal
test-index 0 r STARTED 0 208b 10.0.3.198 ip-10-0-3-198.us-west-2.compute.internal
- Kill node containing primary which instantly promotes replica as primary
[root@ip-10-0-5-122 ~]# ps -aux | grep opensearch
[root@ip-10-0-5-122 ~]# kill 2945
[root@ip-10-0-4-169 opensearch]# curl -X GET "localhost:9200/_cat/shards?v"
index shard prirep state docs store ip node
test-index 0 p STARTED 2980 174.7kb 10.0.3.198 ip-10-0-3-198.us-west-2.compute.internal
test-index 0 r UNASSIGNED
- Wait for ingestion to complete. The searchable doc count is less than ingested. Index refresh and flush don't have any impact on count.
[root@ip-10-0-4-169 opensearch]# curl -X GET "localhost:9200/_cat/shards?v"
index shard prirep state docs store ip node
test-index 0 p STARTED 59997 2.3mb 10.0.3.198 ip-10-0-3-198.us-west-2.compute.internal
test-index 0 r STARTED 59997 3.1mb 10.0.4.82 ip-10-0-4-82.us-west-2.compute.internal
root@ip-10-0-4-169 opensearch]# curl -X POST localhost:9200/test-index/_refresh
{"_shards":{"total":2,"successful":2,"failed":0}}[root@ip-10-0-4-169 opensearch]#
[root@ip-10-0-4-169 opensearch]# curl -X GET "localhost:9200/_cat/shards?v"
index shard prirep state docs store ip node
test-index 0 p STARTED 59997 2.2mb 10.0.3.198 ip-10-0-3-198.us-west-2.compute.internal
test-index 0 r STARTED 59997 2.2mb 10.0.4.82 ip-10-0-4-82.us-west-2.compute.internal
Expected behavior
All ingested documents should be searchable
Host/Environment (please complete the following information):
- OS: Linux AL2
- Version: OpenSearch 2.x
Additional context
- Setup. 3 data node (c5.xlarge), 1 master (c5.xlarge)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done