Skip to content

Test whether OpenSearch has changed the behavior of routing_partition_size on index creation for OpenSearch issue #17472

Notifications You must be signed in to change notification settings

camerondurham/bug-repro-opensearch-routing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

OpenSearch Routing Partition Size Bug Reproduction

This status badge "passing" means that you still have to remember to set number_of_routing_shards AND routing_partition_size when creating the index in order to have equally distributed writes in OpenSearch.

Test OpenSearch Routing Bug

This repo just contains a test script reproducing the last known behavior until the related issue is fixed in OpenSearch:

  • OpenSearch #17472 - Index setting partition size is ignored if routing num shard setting is not specified

Also see:

Bug Description

When creating an index with:

  • routing_partition_size: 2
  • Required routing
  • No number_of_routing_shards specified

All documents with the same routing value get assigned to the same shard, instead of being distributed across multiple shards as expected.

Running the Test

# run with opensearch 1, 2, 3 release (from tags: https://gallery.ecr.aws/opensearchproject/opensearch)
# have only tested so far with 1 or 2
./opensearch_routing_bug.sh 1

The script will:

  • Check if OpenSearch is running locally
  • Create two test indices:
    1. With number_of_routing_shards
    2. Without number_of_routing_shards
  • Insert test documents with the same routing value
  • Show shard distribution for both cases and assert whether the behavior has changed or not

Expected vs Actual Behavior

Expected:

  • Documents with the same routing value should be distributed across 2 shards (as specified by routing_partition_size)

Actual:

  • With number_of_routing_shards: Documents are correctly distributed
  • Without number_of_routing_shards: All documents go to the same shard

About

Test whether OpenSearch has changed the behavior of routing_partition_size on index creation for OpenSearch issue #17472

Topics

Resources

Stars

Watchers

Forks

Languages