[SERVER-9142] turning on usePowerOf2Sizes throws error on sharding with auth Created: 27/Mar/13  Updated: 10/Dec/14  Resolved: 27/Mar/13

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 2.3.2
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Kay Agahd Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-8409 collMod doesn't work when run through... Closed
Related
Operating System: Linux
Participants:

 Description   

I wanted to switch on usePowerOf2Sizes and got the follwing error:

MongoDB shell version: 2.2.1
connecting to: sx210:27018/admin
mongos> use offerStore
switched to db offerStore
mongos> db.runCommand( {collMod: "offer", usePowerOf2Sizes : true })
{
    "raw" : {
        "offerStoreDE2/172.16.242.1:27018,s127:27018,s131:27018,s136:27018" : {
            "usePowerOf2Sizes_old" : false,
            "errmsg" : "unknown command: $auth",
            "ok" : 0
        },
        "offerStoreDE3/s124:27018,s129:27018,s132:27018" : {
            "usePowerOf2Sizes_old" : false,
            "errmsg" : "unknown command: $auth",
            "ok" : 0
        },
        "offerStoreDE4/s115:27018,s117:27018,s125:27018" : {
            "usePowerOf2Sizes_old" : false,
            "errmsg" : "unknown command: $auth",
            "ok" : 0
        }
    },
    "ok" : 0,
    "errmsg" : "{ offerStoreDE2/172.16.242.1:27018,s127:27018,s131:27018,s136:27018: \"unknown command: $auth\", offerStoreDE3/s124:27018,s129:27018,s132:27018: \"unknown command: $auth\", offerStoreDE4/s115:27018,s117:27018,s125:27018: \"unknown command: $auth\" }"
}

My mongo shell version is 2.2.1. MongoDB is v2.2.3 Linux 64 bit. We are running mongo with --keyfile option.

When I run the command against a replSet primary, it worked:

MongoDB shell version: 2.2.1
connecting to: s117:27018/admin
offerStoreDE4:PRIMARY> use offerStore
switched to db offerStore
offerStoreDE4:PRIMARY> db.runCommand( {collMod: "offer", usePowerOf2Sizes : true })
{ "usePowerOf2Sizes_old" : true, "ok" : 1 }
offerStoreDE4:PRIMARY>

Hence my question: Does usePowerOf2Sizes work with sharding and auth or do we need to run the command against all shard members?



 Comments   
Comment by Spencer Brody (Inactive) [ 27/Mar/13 ]

That shouldn't be necessary - running it through mongos should indeed work, it just erroneously returns an error message. You can confirm that it was successful by querying the system.namespaces entry for this collection on each primary. You should see "flags:1", indicating that the userPowerOf2Sizes flag has been set.

Comment by Kay Agahd [ 27/Mar/13 ]

Is there a workaround, perhaps running the command against all shard members?

Comment by Spencer Brody (Inactive) [ 27/Mar/13 ]

This is a known issue: SERVER-8409. Should be fixed in 2.4.

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