[SERVER-6811] prefix shard keys index bounds handling Created: 21/Aug/12  Updated: 11/Jul/16  Resolved: 22/Aug/12

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 2.2.0-rc1
Fix Version/s: 2.2.0-rc2, 2.3.0

Type: Bug Priority: Major - P3
Reporter: Greg Studer Assignee: Kevin Matulef
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File deletion_range.js    
Issue Links:
Depends
Related
related to SERVER-6809 splitVector doesn't filter additional... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

If we shard over

{ x : 1 }

with index

{ x : 1, y : 1 }

, and have chunks A:

{x:2}

->

{x:3}

and B:

{x:3}

->

{x:4}

, a document D :

{ x : 3, y : "abcde" }

is currently included in migrations and other operations for both A and B.

This is b/c when we get index key bounds from the prefix, we complete them with MinKey for min and MaxKey for max, so the index max bound of A is

{x:3,y:MaxKey}

and the index min bound of B is

{x:3,y:MinKey}

, and both ranges overlap D. Included test shows how this results in extra documents removed during migration.

Proposed solution - complete with just MinKey?

The problem is harder to trigger with our standard tests with _id indexes, not sure why.



 Comments   
Comment by auto [ 04/Sep/12 ]

Author:

{u'date': u'2012-08-21T14:19:11-07:00', u'email': u'matulef@10gen.com', u'name': u'Kevin Matulef'}

Message: SERVER-6809 SERVER-6811 cleanup and add prefix sharding tests
Branch: master
https://github.com/mongodb/mongo/commit/814e1526cae18e828c83ab4e6ce40ba8423cd1fe

Comment by auto [ 21/Aug/12 ]

Author:

{u'date': u'2012-08-20T19:01:39-07:00', u'email': u'matulef@10gen.com', u'name': u'Kevin Matulef'}

Message: SERVER-6809 SERVER-6811 fix chunk bounds for prefix shard keys
Branch: v2.2
https://github.com/mongodb/mongo/commit/7ab12c2e100da04aa7fcfe6946e5eae082777209

Comment by auto [ 21/Aug/12 ]

Author:

{u'date': u'2012-08-20T19:01:39-07:00', u'email': u'matulef@10gen.com', u'name': u'Kevin Matulef'}

Message: SERVER-6809 SERVER-6811 fix chunk bounds for prefix shard keys
Branch: master
https://github.com/mongodb/mongo/commit/774853dbd649b346146ad5bacb7127b67679351f

Comment by Greg Studer [ 21/Aug/12 ]

Interactions with MaxKey are a bit wonky here - in theory, though almost no one will come across a case where it will matter, we'd want the final chunk to always be MaxKeys. Otherwise you could miss docs like

{ x : MaxKey, y : "abcde" }

.

Generated at Thu Feb 08 03:12:45 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.