thread 1 gets lock on indexName, from getNextId, for instance
thread 2 calls synch'd getShardInfo method
thread 1 calls getShardInfo inside of indexName lock, blocks waiting
for thread 2 to finish
thread 2 hits the indexName lock inside of getShardInfo and deadlocks
traced all paths and made some lock changes:
- nextReservedId is only called from inside indexName lock, so no need
to lock it in that method
- almost all calls to getShardInfo were inside of an indexName lock, so
took out the indexName lock in that method
- added an indexName lock around the getShardInfo call inside of
getMaxId, for safety's sake