edelight / chef-mongodb

MongoDB Chef cookbook
https://community.opscode.com/cookbooks/mongodb
Apache License 2.0
363 stars 3 forks source link

bug fix in member_config for having _id > 255 #410

Closed yuhanz closed 8 years ago

yuhanz commented 8 years ago

I encountered this problem of having _id > 255 where mongodb considers it as invalid _id. The current recipe will get max_id += 1, which leads _id to grows to the top value.

The validation logic is here: https://github.com/mongodb/mongo/blob/master/src/mongo/db/repl/member_config.cpp#L225

To fix the problem, instead of using max_id +=1, we pick a value between [0,255] for _id, excluding the _id's have existed in the member configs.

thomas-riccardi commented 8 years ago

This project is dead, the active fork is at https://github.com/chef-brigade/mongodb-cookbook where you can get this PR merged.

thomas-riccardi commented 8 years ago

Also, please use a stable url for the link to the mongodb server code in your commit message: https://github.com/mongodb/mongo/blob/r3.2.0/src/mongo/db/repl/member_config.cpp#L225

yuhanz commented 8 years ago

Thanks.

I copied this patch to chef-brigade/mongodb-cookbook and created another pull request at: https://github.com/chef-brigade/mongodb-cookbook/pull/101