OAK-579 Query: for joins, sometimes no or the wrong index is used

git-svn-id: https://svn.apache.org/repos/asf/jackrabbit/oak/trunk@1437366 13f79535-47bb-0310-9956-ffa450edef68
OAK-566 - MongoMK throws exception when adding nodes concurrently

Added a simple test case that exhibits the behavior described in the bug

git-svn-id: https://svn.apache.org/repos/asf/jackrabbit/oak/trunk@1437415 13f79535-47bb-0310-9956-ffa450edef68
Merge branch 'trunk' of https://github.com/apache/jackrabbit-oak into trunk