Loading...
Loading...
mongos attaches shardVersion for sharded collections and attaches databaseVersion for unsharded collection, however mirrored reads only attach shardVersion but not databaseVersion (e.g. here and here). The missing databaseVersion may cause the same problem as in SERVER-55412 (which attached shardVersion for mirrored reads) because from looking at this code, it seems missing databaseVersion may also result in the INCLUDE_SHARD_FILTER query phase to be dropped which is the same issue in SERVER-55412. To clarify, either a shardVersion or a databaseVersion is sufficient to ensure that the INCLUDE_SHARD_FILTER query phase will be enabled. However, for unsharded collections, the logic in the ShardFilter stage that would access routing table metadata doesn't execute; instead, we rely on the database sharding state check to refresh the routing table. A missing databaseVersion will cause that check to return early without raising the exception that forces the routing table to be refreshed.
xgen-internal-githook commented on Tue, 26 Sep 2023 18:26:46 +0000: Author: {'name': 'James Bronsted', 'email': 'james.bronsted@mongodb.com', 'username': 'jpbronsted'} Message: SERVER-79471 include databaseVersion in mirrored reads (cherry picked from commit 1e286d48d8bad81bdd4e11e5717fb72d5f3c0084) Branch: v4.4 https://github.com/mongodb/mongo/commit/fc9d31dfc046c161802e2d72c613822460610969 xgen-internal-githook commented on Tue, 26 Sep 2023 18:00:41 +0000: Author: {'name': 'James Bronsted', 'email': 'james.bronsted@mongodb.com', 'username': 'jpbronsted'} Message: SERVER-79471 include databaseVersion in mirrored reads (cherry picked from commit 1e286d48d8bad81bdd4e11e5717fb72d5f3c0084) Branch: v7.0 https://github.com/mongodb/mongo/commit/a1e2e227762163d8fc405f56708d41ec3d34b550 xgen-internal-githook commented on Tue, 26 Sep 2023 17:21:12 +0000: Author: {'name': 'James Bronsted', 'email': 'james.bronsted@mongodb.com', 'username': 'jpbronsted'} Message: SERVER-79471 include databaseVersion in mirrored reads (cherry picked from commit 1e286d48d8bad81bdd4e11e5717fb72d5f3c0084) Branch: v6.0 https://github.com/mongodb/mongo/commit/ff5a4e42a462e43e4dd1257b8cdb7df5dbd5b241 xgen-internal-githook commented on Tue, 26 Sep 2023 17:15:12 +0000: Author: {'name': 'James Bronsted', 'email': 'james.bronsted@mongodb.com', 'username': 'jpbronsted'} Message: SERVER-79471 include databaseVersion in mirrored reads (cherry picked from commit 1e286d48d8bad81bdd4e11e5717fb72d5f3c0084) Branch: v5.0 https://github.com/mongodb/mongo/commit/a3ef7f0536f5c89f70fd1f29d36e50f4d11e6dd4 xgen-internal-githook commented on Mon, 25 Sep 2023 20:16:05 +0000: Author: {'name': 'James Bronsted', 'email': 'james.bronsted@mongodb.com', 'username': 'jpbronsted'} Message: SERVER-79471 include databaseVersion in mirrored reads Branch: master https://github.com/mongodb/mongo/commit/1e286d48d8bad81bdd4e11e5717fb72d5f3c0084 JIRAUSER1258790 commented on Fri, 28 Jul 2023 17:02:22 +0000: From sergi.mateo-bellido@mongodb.com: "For reads over unsharded collections the routers attach 2 things: the proper dbVersion and a dummy shardVersion that just states that the collection is unsharded. Having the proper dbVersion is what give us the guarantee that the read will be routed to the primary shard. When a mongod process replicates that read, it should also include the dbVersion, otherwise we won't be able to validate whether that read was routed to the right node."
MongoDB Integration
Learn more about where this data comes from
Bug Scrub Advisor
Streamline upgrades with automated vendor bug scrubs
BugZero Enterprise
Wish you caught this bug sooner? Get proactive today.