Undocumented asynchronous index propagation over shards

14 views
Skip to first unread message

Grégoire Seux

unread,
Oct 25, 2012, 12:03:05 PM10/25/12
to mongod...@googlegroups.com

When you create an index on one shard (connecting directly to its primary), other shards will eventually create the same index.

It seems that it takes between 10 to 24 hours to propagate.
I have reproduced this behavior on two distinct clusters.

Is this an expected behavior ?


I think this is not good because you might want to control when index are created on each shard (because this blocking the secondaries, even you use the background option).

I have arlready created a bug track : https://jira.mongodb.org/browse/SERVER-7469


-- 

Grégoire

Jenna deBoisblanc

unread,
Nov 1, 2012, 12:09:19 PM11/1/12
to mongodb-user
For any future mongodb-users, here is the explanation (taken from the
JIRA ticket above) for the observed behavior:

Index creation happens as a first chunk moves to a new shard for a
sharded collection. The collection should be empty on the first chunk
move, so there's not much impact.

If you are directly connecting to a shard and creating an index for a
sharded collection, this is unsupported as many operations may assume
a sharded collection has the same indexes everywhere. As chunks move,
you'd then get index creation sporadically (potentially on large
datasets). The intended use case is to create the index via mongos.
Reply all
Reply to author
Forward
0 new messages