[SERVER-6676] features1.js checkShardingIndex fails with 2.0 mongod 2.2 mongos Created: 01/Aug/12  Updated: 09/Aug/12  Resolved: 03/Aug/12

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 2.2.0-rc0
Fix Version/s: None

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: Text File multiversion_error.txt    
Issue Links:
Related
Operating System: ALL
Participants:

 Description   

Log from failure is attached. Prevents the sharding of a collection over particular keys, unclear what patterns trigger this but potentially only when the shard key is not an exact match for the index key.



 Comments   
Comment by auto [ 03/Aug/12 ]

Author:

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

Message: SERVER-6676 ignore features1 in multi-version suite
Branch: master
https://github.com/mongodb/mongo/commit/a267fce485de9d52c73ad3c5637c43602d286a0f

Comment by Kevin Matulef [ 03/Aug/12 ]

FYI, if you have a 2.2 mongos talking to a 2.2 mongod, and you take the above steps, sharding the collection will succeed. However if you also have other shards running 2.0, they won't be able to receive chunks until they are also upgraded. The error message you will get if you try to migrate chunks to the 2.0 shards will look like the following:

Fri Aug  3 17:03:07 [migrateThread] ERROR: migrate failed: assertion db/dbhelpers.cpp:252
Fri Aug  3 17:03:14 [migrateThread]  test.foo Assertion failure ii >= 0 db/dbhelpers.cpp 252

Comment by Kevin Matulef [ 03/Aug/12 ]

Actually, this isn't really an issue, since the shardCollection command should fail if try to shard on a prefix shard key but your mongod is still on 2.0.

Right now, if you have a 2.2 mongos talking to a 2.0 mongod, and you try to shard a new empty collection, here's what you get:

> db.foo7.ensureIndex( { num : 1 , a : 1 } , true );
> db.adminCommand( { shardcollection : "test.foo7" , key : { num : 1 } } );
{ "ok" : 0, "errmsg" : "couldn't find index over splitting key" }

To solve this, you either need to upgrade your mongod, or create an index just on

{ num : 1 }

.

Comment by Kevin Matulef [ 03/Aug/12 ]

The issue with features1.js is that mongos 2.2 is more permissive about the shard keys it allows (anything that's a prefix of an existing index. see SERVER-1506) but mongod 2.0 doesn't know how to utilize such an index unless it's an exact match for the shard key.

Comment by Greg Studer [ 01/Aug/12 ]

index1.js also fails with 2.0/2.2 for I think the same reason, but other changes post-2.0 exclude it from being automatically tested.

Comment by Greg Studer [ 01/Aug/12 ]

also note - error output was gathered by manually pushing up the logLevel to 1 on mongod and printing out the command result right before the assert, hence the extra messages.

Comment by Greg Studer [ 01/Aug/12 ]

note - features1.js hasn't been modified significantly since 2.0.

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