All Questions
Elasticsearch medium

Why is it generally impossible to change the number of Primary Shards in an index without performing an expensive 'Reindex' operation?

  1. A The underlying Lucene directory structure is physically locked by the operating system.
  2. B Hashing Consistency: Document routing relies on the formula `shard = hash(_id) % number_of_primary_shards`. Changing the divisor (the shard count) would cause the hash to point to the wrong server, making all existing documents unreachable.
  3. C The master node cannot track more than the initial number of shards for a single index ID.
  4. D It requires a full license for the 'Elastic Premium' tier.

One system design question a day, with spaced repetition so the ones you miss come back.

Get the app

Related questions