Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sharding support implemented #691

Closed
wants to merge 2 commits into from
Closed

Sharding support implemented #691

wants to merge 2 commits into from

Conversation

lotar
Copy link

@lotar lotar commented Oct 17, 2013

No description provided.

} elseif (property_exists($annot, 'options')
&& isset($annot->options['isShardKey'])
&& $annot->options['isShardKey'] == true) {
$class->addShardKey($mapping['fieldName']);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the order of calls to addShardKey() can change based on the parsing order for fields, that could easily break. Would it be better to define a shard key similar to a compound index at the class level?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've just looked for relevance in shard key order when querying but haven't found anything. LMK if I'm wrong, but AFAIK order of keys is irrelevant.

Also, in JS console look at the following scenario:

mongos> db.MessageThreads2.update({_id: 'testlotar', fu: 1}, {$set: {test:1}}, true)
can't upsert something without full valid shard key : { _id: "testlotar", fu: 1.0 }
mongos> db.MessageThreads2.update({_id: 'testlotar', fu: 1, tId:1}, {$set: {test:1}}, true)
mongos> db.MessageThreads2.findOne({_id : 'testlotar'})
{ "_id" : "testlotar", "fu" : 1, "tId" : 1, "test" : 1 }
mongos> db.MessageThreads2.remove({_id: 'testlotar'})
mongos> db.MessageThreads2.findOne({_id : 'testlotar'})
null
mongos> db.MessageThreads2.update({_id: 'testlotar', tId:1, fu:1}, {$set: {test:1}}, true)
mongos> db.MessageThreads2.findOne({_id : 'testlotar'})
{ "_id" : "testlotar", "fu" : 1, "tId" : 1, "test" : 1 }
mongos> db.MessageThreads2.remove({_id: 'testlotar'})
mongos> db.MessageThreads2.findOne({_id : 'testlotar'})
null

and the shard key is following:

mongos> db.MessageThreads2.getIndexKeys()
[
    {
        "tId" : 1,
        "fu" : 1
    }

As I wrote, if I'm wrong LMK and will reconsider, but otherwise don't see a point in it.

@jmikola
Copy link
Member

jmikola commented Oct 28, 2013

Left some quick comments but I will have to set time aside to thoroughly review this later. I noticed that it can't automatically be merged, so it'd be helpful to rebase on master when you get a chance, so the changeset is conflict-free.

Does this PR build on #325, or did you start it from scratch?

@j
Copy link
Contributor

j commented Nov 11, 2013

@jmikola we're finally hitting IO problems and had to shut down some of our ETLs due to not sharding some of our stuff. I don't quite have time to contribute right now. I'm probably going to have to add sharding to our events databases to mitigate our current situation, then add sharding to our ODM stuff whenever it gets implemented.

:( :(

@lotar
Copy link
Author

lotar commented Nov 11, 2013

@jmikola I've replied inline, and other things you're suggesting as rebasing it - not a problem, just don't wan't to waste anyone's time if it won't be merged in.

Regarding #325 question, that one has been sitting around for a while now, and I did it from scratch.

P.S. It's being used in production (proposed pull request) for few months now and there was no issues with it.

@sirian
Copy link

sirian commented Apr 19, 2014

Any news? Will be merged?

@jmikola jmikola added this to the 1.0.0-BETA11 milestone May 6, 2014
@jmikola jmikola added the feature label May 6, 2014
@jmikola
Copy link
Member

jmikola commented May 6, 2014

Moving this for consideration in the next milestone.

@jmikola jmikola modified the milestones: 1.0.0-BETA12, 1.0.0-BETA11 Jun 6, 2014
@notrix
Copy link
Contributor

notrix commented Jan 19, 2015

👍

@jmikola jmikola modified the milestones: 1.0.0-BETA12, 1.0.0-BETA13 Feb 24, 2015
@malarzm malarzm modified the milestones: 1.0.0-BETA13, 1.0.0-BETA14 May 20, 2015
@malarzm malarzm modified the milestones: 1.0.0-BETA14, 1.x Jun 11, 2015
@malarzm malarzm modified the milestones: 1.x, 1.1 Oct 31, 2015
@malarzm malarzm modified the milestones: 1.1, 1.x Oct 31, 2015
@alcaeus
Copy link
Member

alcaeus commented Mar 14, 2016

Superseded by #1385.

@alcaeus alcaeus closed this Mar 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants