As described in #2214, we have a race condition when two splits attempt to create an index at the same time. It is possible that the second split fails because it does not wait for shards to actually exist before attempting to use them. We only fetch shards in order to pick the node to write to, so it's not even necessary for the code to work (since any node will do). This change makes it so that if no shards exist we will just pick a random node to write to.
Closes #2214
As described in #2214, we have a race condition when two splits attempt to create an index at the same time. It is possible that the second split fails because it does not wait for shards to actually exist before attempting to use them. We only fetch shards in order to pick the node to write to, so it's not even necessary for the code to work (since any node will do). This change makes it so that if no shards exist we will just pick a random node to write to. Closes #2214