PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Wednesday the 20th of May, 2015

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[02:42:03] <Auger> can someone point me in the right direction with this:
[02:42:17] <Auger> I have a collection of comments
[02:42:29] <Auger> each comment is a new entry and is attached to a post
[02:42:43] <Auger> each comment has a children array
[02:43:00] <Auger> i'm trying to most efficiently retrieve all the comments and their children
[02:43:23] <Auger> currently i'm doing a .find() that gets me all top level comments
[02:44:59] <Auger> sorry i forgot to mention that each comment saves its parent comment as well
[02:45:49] <Auger> so after i load all top level comments, i do each comment one by one and find comments that have it as a parent and load them
[02:46:01] <Auger> i'm guessing there must be a better way
[04:28:26] <pwlarry> hi
[04:37:13] <arussel> if a user needs anyAction, does he *has to* first connect to the admin db ?
[04:40:50] <pwlarry> is anyone free to help me figure out a data structure for a prototype? going round in circles.
[07:43:15] <hmblcodr> I'm learning about noSql databases and was wondering if mongodb would make a good candidate to store user account data?
[08:23:40] <OhMyGuru> hi
[08:53:40] <KekSi> i'm having trouble with the mongodb java driver - MongoCredential.createMongoX509Credential in particular -- somehow it doesn't seem to read the correct certificate from the keystore i put in - can anyone help me with that?
[09:04:35] <maasan> mongodb is using lot of memory. How do i limit the memory?
[09:34:23] <maasan> exit
[09:43:00] <Har1ekin> Hello @all
[09:43:35] <Har1ekin> Is it possible to set mandatory fields in mongodb (no 3rd party things like mongoose or mongoengine)?
[09:54:52] <Har1ekin> Is it possible to set mandatory fields in mongodb (no 3rd party things like mongoose or mongoengine)?
[10:20:20] <jamiel> You mean, like a schema?
[10:21:22] <Har1ekin> not exactly, there is ONE special field that must not (under no circumstance) be null or our hardware brakes
[10:22:51] <Har1ekin> my boss just want's to make sure (in addition to the check our main application is running before inserting into mongo) that the db throws back any inserts/updates, that would turn this field into null or empty
[10:23:51] <Har1ekin> like good old sql does... but mongo would be better for our product and i can't convince him without this "feature"
[10:27:48] <arussel> Har1ekin: no, this is an application level feature, mongo don't do this
[11:19:55] <mitereiter> hi all
[11:20:10] <Har1ekin> hi
[11:20:21] <mitereiter> i have a question with tag aware sharding
[11:20:38] <mitereiter> i got a tag range like this
[11:20:42] <mitereiter> tag: shard0003 { "_id.countryCode" : "USA", "_id.firNR" : { "$minKey" : 1 } } -->> { "_id.countryCode" : "USA", "_id.firNR" : { "$maxKey" : 1 } }
[11:20:56] <mitereiter> but i got such chunks
[11:21:25] <mitereiter> { "_id.countryCode" : "USA", "_id.firNR" : NumberLong(24124079) } -->> { "_id.countryCode" : "USA", "_id.firNR" : NumberLong(24231503) } on : shard0001 Timestamp(1, 1603)
[11:22:23] <mitereiter> so isn't it suposed to be moved to the shard specified by the tagrange?
[11:43:03] <Har1ekin> can i use a shard on multiple mongos (a global config database, that has to be available for all regional systems)?
[12:37:07] <einyx> hello
[12:37:30] <einyx> i can login with admin from localhost but i can't remotely
[12:37:37] <einyx> even though i'm using --authenticationDatabase admin
[12:37:42] <einyx> any idea on why?
[12:40:09] <StephenLynx> by default
[12:40:15] <StephenLynx> mongo only takes local connections
[12:40:33] <StephenLynx> it binds to 127.0.0.1 on /etc/ some config file.
[12:40:36] <StephenLynx> einyx
[12:40:52] <einyx> yeah i have bind on 0.0.0.0
[12:40:56] <StephenLynx> hm
[12:40:59] <einyx> and security.authorization on enabled
[12:41:19] <einyx> :(
[12:41:37] <StephenLynx> then I dunno. I didn't fiddled enough with auth to tell you all the intricacies of mongo auth system
[12:42:12] <einyx> :(
[12:44:05] <einyx> i use a keyfile to authenticate the member between them and authorizazion enabled to authetnicate the user
[12:44:13] <einyx> i wonder if this is causing problem?
[12:44:49] <einyx> aha
[12:44:52] <einyx> AuthenticationFailed MONGODB-CR credentials missing in the user document
[12:45:31] <einyx> bingo
[12:45:32] <einyx> https://jira.mongodb.org/browse/SERVER-17459
[12:47:38] <einyx> cannot believe i wasted a morning on this
[12:47:42] <einyx> :(
[12:47:50] <StephenLynx> kek
[12:47:57] <jdo_dk> is it possible to get objectID of updated document ?
[12:48:12] <StephenLynx> you can do a findAndModify and retrieve the document.
[12:48:25] <StephenLynx> either after or before the update.
[12:48:40] <jdo_dk> StephenLynx: Thanks.
[12:48:43] <einyx> i think i need to update the driver
[12:48:50] <einyx> the app use old drivers
[12:52:06] <mitereiter> i have a question with tag aware sharding
[12:52:06] <mitereiter> i got a tag range like this
[12:52:06] <mitereiter> tag: shard0003 { "_id.countryCode" : "USA", "_id.firNR" : { "$minKey" : 1 } } -->> { "_id.countryCode" : "USA", "_id.firNR" : { "$maxKey" : 1 } }
[12:52:06] <mitereiter> but i got such chunks
[12:52:20] <mitereiter> { "_id.countryCode" : "USA", "_id.firNR" : NumberLong(24124079) } -->> { "_id.countryCode" : "USA", "_id.firNR" : NumberLong(24231503) } on : shard0001 Timestamp(1, 1603)
[12:52:21] <mitereiter> so isn't it suposed to be moved to the shard specified by the tagrange?
[14:00:25] <fxmulder> so one of my mongod's won't start, I can start it standalone but starting in the replica set fails with Wed May 20 07:50:14.594 Invalid access at address: 0x73ac2e8504e8 from thread: repl writer worker 1
[14:01:00] <GothAlice> "Alerts Temporarily Disabled", thanks, MMS. :/
[14:21:54] <mitereiter> i got a tag range like this
[14:21:54] <mitereiter> tag: shard0003 { "_id.countryCode" : "USA", "_id.firNR" : { "$minKey" : 1 } } -->> { "_id.countryCode" : "USA", "_id.firNR" : { "$maxKey" : 1 } }
[14:21:55] <mitereiter> but i got such chunks
[14:22:13] <mitereiter> { "_id.countryCode" : "USA", "_id.firNR" : NumberLong(24124079) } -->> { "_id.countryCode" : "USA", "_id.firNR" : NumberLong(24231503) } on : shard0001 Timestamp(1, 1603)
[14:22:14] <mitereiter> so isn't it suposed to be moved to the shard specified by the tagrange?
[14:22:23] <aps> Hi. I'm new to mongodb and have a doubt. Is it advisable to "have the backup replica servers in one shard serving as the other shard primary (replica of primary of other shard)"?
[14:22:46] <aps> like it's mentioned here - https://github.com/ansible/ansible-examples/tree/master/mongodb#deploy-the-cluster
[14:45:23] <dorongutman> hi
[14:45:51] <dorongutman> I’m using MMS and today I received an alert that the monitoring agent is down
[14:45:59] <mike_edmr> dorongutman: cool name
[14:46:09] <mike_edmr> idk what it means but it has a nice sound to it
[14:46:20] <dorongutman> mike_edmr: thanks :-)
[14:46:25] <dorongutman> it’s just my name
[14:47:26] <dorongutman> anyways - connecting to the primary and trying to run the monitoring agent manually (/var/lib/mongodb-mms-automation/mongodb-mms-monitoring-agent-3.3.0.183-1.linux_x86_64/mongodb-mms-monitoring-agent ) prompts the following error:
[14:48:15] <dorongutman> http://pastebin.com/RNmafap5
[16:23:20] <jkli> why is mongodb faster than mysql?
[16:23:32] <Spec> it's webskale
[16:23:41] <jkli> is it because oracle is staggering mysql development?
[16:24:00] <jkli> webscale is a word?
[16:24:35] <StephenLynx> lol
[16:24:42] <StephenLynx> webscale is an intern joke
[16:24:59] <StephenLynx> it is faster because it doesn't implement stuff like relational integrity check, type checks
[16:25:03] <StephenLynx> schema enforcing
[16:25:14] <StephenLynx> and doesn't write to disk immediatly.
[16:25:16] <jkli> so it is lazy
[16:25:19] <StephenLynx> aye.
[16:25:26] <jkli> sounds good
[16:25:39] <StephenLynx> yeah, its pretty great at what it does.
[16:25:40] <jkli> if you are building social networks and stuff
[16:25:45] <StephenLynx> actually
[16:25:49] <StephenLynx> it would be kind of bad for that.
[16:25:55] <StephenLynx> because there are too much relations.
[16:26:00] <jkli> but i like atomic for business transactions
[16:26:08] <StephenLynx> and you either duplicate data or perform joins.
[16:26:17] <StephenLynx> yeah, that too, mongo doesn't have transactions.
[16:26:32] <StephenLynx> too many relations*
[16:26:36] <jkli> mmhm
[16:26:55] <StephenLynx> the need for relations can be alleviated by using subdocuments.
[16:27:04] <StephenLynx> and transactions.
[16:27:22] <jkli> hmmh
[16:27:35] <jkli> so in what kind of field is it used for
[16:27:45] <jkli> where it excels compared to like mysql
[16:28:10] <StephenLynx> systems where you have a high load to handle, where you don't need to stitch data together dynamically.
[16:28:29] <StephenLynx> gridfs also makes it excellent for storing files.
[16:28:31] <fewknow> jkli: it is different and used for different patterns than mysql
[16:29:15] <fewknow> i use a combination of relational, mongodb, elastic search and hadoop
[16:29:22] <StephenLynx> also from what I heard, its easier to build shards with mongo
[16:29:41] <fewknow> StephenLynx: that is an understatement compared to mysql
[16:30:13] <StephenLynx> never built a cluster with neither so I try to not make bold statements related to that :v
[16:31:49] <fewknow> StephenLynx: understand...i have built with both...
[16:31:49] <StephenLynx> so in general, don't expect mongo to be neither a full replacement for relational dbs nor useless compared to them. databases are one of those things you just can't have a one-size-fits-all
[16:32:10] <fewknow> +1 ^
[16:32:39] <StephenLynx> but from what I have experienced with both, its harder to screw up with relational dbs.
[16:32:58] <StephenLynx> specially with small projects.
[16:33:06] <fewknow> StephenLynx: that is true....that is why most people don't like mongoDB
[16:33:09] <Spec> i'm from operations, and i can tell you it's easy to screw up with everything.
[16:33:18] <fewknow> isn't mongoDb that messes up ... it is the developer that doesn't know what they are doing
[16:33:25] <StephenLynx> but if you have the time, is very worthwhile to learn mongo.
[16:33:36] <StephenLynx> its a very capable, stable and productive tool in its own terms.
[16:34:11] <StephenLynx> jkli
[16:40:04] <jkli> i see thx for info
[16:46:48] <flicknick> mongodb keeps losing data... sigh
[16:50:19] <daidoji> flicknick: losing?
[16:53:41] <flicknick> daidoji: yes, missing data in replicas, started to happen with 3.0. very rare, but it's happening.
[16:53:52] <flicknick> very very nasty
[16:54:09] <daidoji> sounds like it
[16:56:18] <cheeser> filed a jira on it?
[17:15:36] <qrome> anyway to make the following NOT return _id? db.users.find({}, {username: 1, phone: 1})
[17:15:48] <_rgn> _id: 0
[17:16:28] <qrome> ahh
[17:16:29] <qrome> thanks
[17:17:17] <StephenLynx> :v
[17:17:41] <StephenLynx> to be fair, _id has this SPECHIAL rule with projection.
[17:17:51] <StephenLynx> by default it is informed and you have to ask for it to not be informed.
[17:18:15] <StephenLynx> how mongo handles _id as a god damn special snowflake is the one thing that really bothers me with mongo
[19:43:10] <deathanchor> pymongo question: created a collection object and running a 20K finds on it (exhausting the cursor each time), basically is going to be the fastest method?
[19:48:50] <deathanchor> ack, now I know why it is slow
[19:49:58] <deathanchor> my query uses an index which doesn't have the field value I want.
[19:54:47] <cheeser> that'd do it
[20:10:55] <Progz> hello, I am new in the mongo world. And I am wondering, is it healthy to have 400 GB of data in one signle mongo server in one database with 4 collection ( 1 : 5 GB, 2 : 10 GB, 3 : 40 GB, 4: 350 GO)
[20:10:59] <Progz> ?
[20:15:21] <GothAlice> Progz: Nothing particularly unusual about that, depending entirely on your data.
[20:16:25] <GothAlice> Progz: I find http://www.devsmash.com/blog/mongodb-ad-hoc-analytics-aggregation-framework to be a useful article not just for if you're doing analytics or aggregation, but because it clearly demonstrates the performance and storage impact of different ways to store the same data. Might be interesting for you to see how design can change storage space.
[20:16:40] <Progz> We have a lot of trouble with our data model and with aggregate taking more than 10 seconde.
[20:17:54] <GothAlice> Then that link may be doubly useful for you. Pre-aggregation lets you organize your data (or a copy of the data) in a way that can give constant-time performance. I.e. to "query a week's worth of data", given 15,000 documents in that week, it'll clearly be faster to sum up 7 daily total documents instead of going through all 15,000 original documents.
[20:18:32] <Progz> GothAlice: thanks, reading
[20:19:00] <GothAlice> (Esp. if the number of documents being evaluated varies based on usage; your queries then have variable performance. Not so much with pre-aggregation; if instead there were 15 *million* documents in that week, the pre-aggregate would still only sum the 7 daily documents. :D
[21:33:26] <pocketprotector> question
[21:33:47] <pocketprotector> anyway to set this before the system boots? /sys/kernel/mm/transparent_hugepage/defrag
[21:34:40] <pocketprotector> the kernel parameter does not fix it
[21:54:52] <hackel> I've got a collection with a composite, sparse, unique index, but keep getting "duplicate key" errors when trying to insert a record without one of the indexed fields. Any ideas?
[21:58:59] <joannac> hackel: works as designed?
[22:07:24] <joannac> hackel: https://jira.mongodb.org/browse/DOCS-5440 (the documentation wording should be clarified)
[22:36:51] <shaggy_surfer> hi
[22:45:27] <spellett> hello
[22:49:15] <shaggy_surfer> :crickets:
[23:10:42] <joannac> shaggy_surfer: did you have a question?
[23:18:45] <shaggy_surfer> joannac: Thanks, I was just testing that I could actually get a response since registering.
[23:26:06] <Antiarc> Is there a place to discuss the design decisions of the mongo driver? Some of the 2.0 changes are really pretty incomprehensible and frustrating. A single global logger? One database per connection?
[23:26:20] <cheeser> "the mongo driver"
[23:26:25] <Antiarc> err, the ruby driver
[23:26:26] <Antiarc> Heh, sorry.
[23:27:35] <Antiarc> Topology detection doesn't seem to properly determine that a single-node replica set is in replica set mode
[23:50:24] <joannac> Antiarc: is there something special you need from the replica set mode?
[23:51:07] <Antiarc> I'm tailing the oplogs to index documents into Elasticsearch, and need to be able to tell if the node I've connected to is a mongos router, a mongod node in RS mode, or a mongod node not in RS mode.
[23:51:35] <Antiarc> Easy to do via various status commands, but it seems like the topology detection should probably do what it suggests on the tin
[23:52:12] <Antiarc> (important, since non-RS nodes won't have an oplog!)
[23:52:17] <joannac> Antiarc: even connecting with the replica set option?
[23:52:49] <Antiarc> It works if you explicitly force connect: :replica_set. But I don't know ahead of time that the target is an RS. I can make that configurable, but the client should be able to figure that out on its own.
[23:53:02] <joannac> no?
[23:53:24] <joannac> if we enabled that, then you would never be able to connect to a specific node in a replica set
[23:54:32] <Antiarc> Sorry, how do you mean? You could force-connect with direct mode if you wanted a single node.
[23:55:44] <Antiarc> I can distinguish between a node that is part of an RS or not via the replSetGetStatus command (and the exception raised if it's not part of an RS), without having to know anything about the target cluster. Just seems odd that the client wouldn't do something similar.
[23:57:20] <Boomtime> Antiarc: again, as joannac says, if we did that then you couldn't connect directly
[23:57:48] <Boomtime> the idea of a replica-set connection is for you to supply multiple hosts in the connection string
[23:58:14] <Boomtime> if you supply only one host then you're not really achieving good resilency to failure since your client can;'t connect if that one host is down
[23:58:44] <Boomtime> thus, there is no getting around the fact that the client must know ahead of time a rough idea of what it's connecting to
[23:59:14] <Boomtime> if it expects a replica-set it will name multiple hosts, to ensure that if any one of them is down it can still contact the remaining members
[23:59:47] <Antiarc> Yup. And if you pass an array with a single entry (ie, RS mode connections), it'll say that you're in single node mode.