PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Friday the 3rd of May, 2013

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:07:10] <ackspony> hmm... my brain is having trouble doing what should be a simple map / reduce procedure
[00:26:49] <toothrot> anyone else ever get a seemingly random "JavaScript execution terminated" error on a group?
[00:45:52] <ralphholzmann> if I'm spinning up a brand new server, am i better off going with 64 bit or 32 bit ?
[00:45:56] <ralphholzmann> ubuntu linux
[00:46:54] <ackspony> 32 bit has a 2GB limit
[00:50:43] <ralphholzmann> ah yeah
[00:50:52] <ralphholzmann> i knew i remembered a reason to not go with 32bit
[00:50:55] <ralphholzmann> thanks ackspony !
[01:23:11] <Zelest> Derick, awake at this hour?
[01:28:41] <Zelest> I don't get how the PHP drivers work..
[01:29:08] <Zelest> The replicaset thingie makes no sense
[01:29:36] <Zelest> What's the point of replication if everything breaks as soon as a single slave node dies? :/
[01:30:06] <Zelest> Why does the PHP driver connect to all nodes (and if one is down, it has to timeout) even when the readpreferences is set to master only?
[01:46:21] <ackspony> Zelest, is that replication or sharding
[01:50:33] <Zelest> ackspony, replication
[01:50:56] <Zelest> when the php-driver connects, it seems like it's running a rs.status() and try to connect to all members
[01:51:10] <Zelest> but if one of them is down, it waits for the timeout to hit before moving on..
[01:51:36] <Zelest> i found http://docs.mongodb.org/manual/tutorial/reconfigure-replica-set-with-unavailable-members/ though
[01:51:47] <Zelest> which sort of "solved" my problems for now..
[01:52:06] <Zelest> i just expected mongodb to just ignore dead nodes unless they came back online
[01:52:36] <Zelest> and my frustration shouldn't be aimed at mongo, mongo rocks.. it should be aimed at the asshats who runs this datacenter :S
[01:56:49] <ackspony> i would expect dead nodes to be ignored, or else what's the sense in having redundancy
[01:57:00] <ackspony> so that does sound frustrating
[01:58:25] <Zelest> mhm
[01:58:50] <Zelest> might have configured something backwards.. but nothing I know of that can affect that.. :/
[02:06:48] <ackspony> what's the simpliest syntax to dereference a singleton array
[03:15:13] <ackspony> i'm having issues understanding how to apply sort() to a .map output
[03:22:34] <danlamanna> anyone know where i can get an example similar to http://cookbook.mongodb.org/patterns/pivot/ but applying to two collections (one referencing the other by _id) ?
[03:26:36] <ackspony> dan, i believe that's jst a 'map'
[03:27:38] <danlamanna> it's quite possible :-/
[03:28:25] <danlamanna> i just have 2 collections, users and items, users has a field named items as an array (reference based one to many) - and i just want to get a collection for user foo that contains the items embedded
[03:28:46] <danlamanna> document*
[06:41:28] <Nilshar> hello.
[06:45:48] <Nilshar> I got 2 mongodb 2.2.0 clusters, on both, when I check rs.status() the primary says : "maintenanceMode" : -4 or on other cluster : "maintenanceMode" : -6 I didn't find anything to explain what is that "maintenanceMode" and the values in the doc. maybe someone can point me some doc about it ? (upgrade to 2.4 is planned, but will take a few time... :) )
[07:20:47] <dforce> Can someone help me with mongodb and pymongo regarding ObjectIds ?
[07:25:58] <ron> dforce: general rule of irc. don't ask to ask. just ask your question and wait patiently for someone to reply.
[07:30:40] <dforce> Iam using pymongo as a driver between mongodb, python and django (web framework). I am having 2 collections within a mongodb. The first collection is a general collection where for one field has ObjectIds ($oid) refering to objects in the second collection. How can I get the content of the second collection when querying the field with those ObjectIds in the first collection ?
[07:35:04] <Nodex> dforce : Mongo doesn't do relationships or joins. If your driver supports them you will need to look in thier docs for "dbRef"
[07:35:56] <Nodex> some drivers/ODMS/ORM's support looking these up for you without -your script- needing to do a second query - A second query is however performed behind the scenes
[07:36:27] <Nodex> if at all possible you should avoid these types of queries and or adjust your data to use relationships as little as possible
[07:36:37] <[AD]Turbo> hi there
[07:38:37] <dforce> Nodex : thanks for the information
[07:38:54] <Nodex> no problemo
[07:53:28] <Zelest> What is the idea behind the PHP driver connecting to all nodes listed in rs.status().members, even those listed as offline?
[07:53:58] <Zelest> It makes the whole point of the replicaset (apart from read-performance) pointless.. if one node dies and the application become useless. :(
[08:00:56] <Nodex> for real zeez?
[08:01:40] <Zelest> Mhm
[08:01:59] <Zelest> One of our nodes died last night.. and my php-fpm takes forever to connect..
[08:02:03] <Zelest> even if the master was online and fine
[08:02:22] <Zelest> i removed the dead nodes ip in the connect line.. still b0rked.. as it gets all the servers from the master
[08:02:45] <Zelest> it waits for the timeout to occur even if rs.status() lists it as unavailable/unhealthy.
[08:04:47] <Nodex> :/
[08:06:04] <Zelest> So a replicaset with 3 nodes is basically, your database with 3 times bigger chances on something breaking. :(
[08:19:50] <oskie> is it possible to change the _id index to hashed?
[08:25:12] <Nodex> your _id can be anything you like
[08:33:11] <oskie> Nodex: yeah but I get some error when I try to remove it
[09:34:22] <phrearch> hi
[09:37:22] <phrearch> is there a common pattern i can use to prevent my nodejs app to crash on a socket hang up ? (seems like the mongodb connection is killed after a while)
[11:38:38] <Nilshar> Hello, I got 2 mongodb 2.2.0 clusters, on both, when I check rs.status() the primary says : "maintenanceMode" : -4 or on other cluster : "maintenanceMode" : -6 I didn't find anything to explain what is that "maintenanceMode" and the values in the doc. maybe someone can point me some doc about it ? (upgrade to 2.4 is planned, but will take a few time... :) )
[11:45:41] <coin3d> hello there. how should i model a many to many relationship within mongo, when the relation itself has an attribute?
[12:03:48] <kali> coin3d: make it so the most frequent request are the least expensive
[12:04:56] <coin3d> kali: this is in fact the same question that i have: http://stackoverflow.com/questions/4839881/how-to-organise-a-many-to-many-relationship-in-mongodb
[12:05:20] <coin3d> this guy has two tables, users and groups, and a relationship table with an extra attribute "isowner"
[12:05:29] <coin3d> would you put that attribute in one of the both collections?
[12:06:29] <kali> coin3d: you're thinking "static". you need to think "dynamic". you can't design for mongodb without having an idea of the querying patterns
[12:07:06] <kali> coin3d: if whenever you access a user you need to know its groups as well, then yes, it makes sense to embbed groups in user
[12:09:01] <Nodex> friday \o/
[12:09:19] <kali> Nodex :)
[12:10:33] <coin3d> well :D
[12:11:11] <coin3d> kali: i didnt say a word about embedding.
[12:11:19] <Nodex> Holiday Monday here too :)
[12:11:27] <coin3d> the stackoverflow post is in fact related to referencing
[12:12:20] <coin3d> i know that the whole mongo db schema design is about knowing your use cases
[12:12:39] <coin3d> however, there have to be some best-practices, or not?
[12:12:55] <kali> coin3d: well, they depend on the use case :)
[12:13:42] <kali> coin3d: i would say one thing: in most cases, do not use a "third" table to model a n-to-n
[12:14:52] <coin3d> kali: you mean a third collection? :D
[12:15:24] <kali> coin3d: :P
[12:15:33] <kali> coin3d: YOU put my mind on relational mode
[12:15:41] <kali> coin3d: you should be ashamed
[12:15:50] <coin3d> kali: i'm sorry :)
[12:16:33] <Zelest> Does all nodes _need_ to be the same version in a replicaset?
[12:16:50] <Zelest> or can I run 2.2 and 2.4 at the same time on different nodes?
[12:17:33] <Nilshar> see http://docs.mongodb.org/manual/release-notes/2.4-upgrade/
[12:17:40] <kali> Zelest: there are some constraints across some versions... secondary can have always have an higher version number
[12:18:42] <Zelest> Aah
[12:18:49] <Zelest> Thanks
[12:24:37] <toxik> wassup anybody on the stockholm mongodb conference?
[12:24:41] <toxik> s/on/at/
[12:25:19] <Zelest> oh, is that now?
[12:26:52] <toxik> yes, afternoon session just started
[12:27:44] <Zelest> aah
[12:33:17] <Nodex> abc
[12:53:58] <danlamanna> hey guys - i have 2 collections (users and items), a user has an items field that is an array (reference based one to many) - i'm trying to figure out how to get a user document with the items embedded
[12:54:06] <danlamanna> does this involve mapreduce?
[12:54:24] <Nodex> please dont map/reduce in production LOL
[12:55:26] <danlamanna> huh? I just installed mongo for the first time on my local machine, just trying to figure it out
[12:56:05] <Nodex> well there is your first lesson :)
[12:56:24] <kali> it's definitely newbies' friday :)
[12:57:20] <danlamanna> well how would i go about the one document with items embedded?
[12:57:36] <Nodex> re-model your data to not have it?
[12:58:41] <danlamanna> well i read the docs on referenced vs embedded - the idea is users could all have the same items, so i didn't want the same item data for every user that has it
[12:58:56] <danlamanna> so i figured an items collection and users having a field referencing item ids was best
[12:59:36] <Nodex> that's a "relational" way of doing things
[13:00:30] <patroy> Hi, I'm trying to setup replication on EC2 and I'm getting this error from the primary "failed: Temporary failure in name resolution".. I know this is an issue with amazon but when that happens, the secondary drops all the data that it had collected and starts over again. I'm just wondering if thats normal behaviour to prevent data corruption? thanks!
[13:00:32] <danlamanna> well i assumed since mongo supported relationships they were fine to a certain extent
[13:00:43] <kali> danlamanna: if you want to keep that design, you need to fetch the ids from the users, then do a queries on items with a _id : { $in: [...] }
[13:00:52] <Nodex> where does it say it supports relationships?
[13:01:11] <danlamanna> Nodex: http://docs.mongodb.org/manual/tutorial/model-referenced-one-to-many-relationships-between-documents/
[13:01:37] <danlamanna> That's what I was going off of, I tried building this in an rdms and ran into some issues that suggested nosql
[13:01:44] <danlamanna> kali: Thanks :)
[13:02:14] <Nodex> that ^^ is a stupid tutorial and shouldn't be on the site
[13:02:42] <Nodex> I can onyl assume it's there to attract more RDMBS types
[13:02:54] <Nodex> + or to prove that things of this nature can be done
[13:03:44] <kali> Nodex: i thinks that's the spirit... it's topped by a reference to "Data modeling considerations", in the middle of a list of a dozen modeling partterns...
[13:04:18] <Nodex> but the RDBMS types will jjst try to follow this which is NOT a good idea
[13:04:34] <Nodex> perhaps it needs a label saying "If you really must live in a relational world then do this...."
[13:31:51] <danlamanna> kali: so the $in idea worked, but you agree with Nodex I should be modeling things differently?
[13:33:58] <kali> danlamanna: depends on your app. you need to consider your most frequent queries and model for them. if displaying a user with its list of items is frequent in your app, then yes, you probably need a refactor
[13:34:54] <coin3d> guys, another newbie question. if a blog document has embedded comments. now there should be a view, which displays just all the comments. is it possible to select only the embedded comments from all blog entries?
[13:35:29] <kali> coin3d: the aggregation framework will do it
[13:35:38] <danlamanna> kali: I would say the most frequent are displaying all items, and then displaying a user with its list of items
[13:35:49] <kali> coin3d: but it will obviously be more expensive than a lookup on a post by id
[13:36:21] <danlamanna> kali: the reason i decided to nosql was because "items" is a loose term, and there are any amount of types of items all with different attributes
[13:36:43] <danlamanna> kali: i actually asked #mysql about my last schema and the general consensus was to use a nosql solution
[13:44:59] <kali> danlamanna: well, why not, but be aware it's far from a drop-in replacement. you need to unlearn and relearn stuff
[14:01:21] <jribnik> i have a three shard cluster across which i built an index; the index appears once on two of the shards and twice on the third
[14:01:25] <jribnik> can anyone make sense of that?
[14:11:44] <Nilshar> Hello, I got 2 mongodb 2.2.0 clusters, on both, when I check rs.status() the primary says : "maintenanceMode" : -4 or on other cluster : "maintenanceMode" : -6 I didn't find anything to explain what is that "maintenanceMode" and the values in the doc. maybe someone can point me some doc about it ?
[14:13:56] <Nilshar> this thing just give NO result on google :/
[14:19:01] <Zardosht> What is the purpose of the "local.slaves" collection in replica sets? I know what it does, it saves the OpTime that slaves have synced to. Is it there just for diagnostic purposes, or does some piece of the internal system actually use it?
[14:20:52] <Derick> Nilshar: all I can find in the source is that they are not constant values - it's a counter of something I can't see what of
[14:21:59] <Zardosht> From my understanding of the source, maintenanceMode is a count of threads that have transitioned a secondary from the RS_SECONDARY state to RS_RECOVERING state
[14:22:26] <Zardosht> running the command "replSetMaintenance" with with true increments it, and running it with false decrements it
[14:22:30] <Nilshar> Derick Zardosht: hum... does not really make sense with negative values :/
[14:22:36] <Zardosht> i know
[14:22:40] <Zardosht> here is a possible bug
[14:23:06] <Zardosht> normally, you one runs it with true to incrmeent, and false to decrement
[14:23:07] <Derick> hmh, looks weird to me too
[14:23:22] <Zardosht> however, if you don't run it with true at first, and only run it with false, I think it can get to negative values
[14:23:24] <Nilshar> and it's supposed to be run on secondary only..
[14:24:10] <Nilshar> really strange :/
[14:24:11] <Zardosht> In the function bool ReplSetImpl::setMaintenanceMode(const bool inc), I don't see any check that ensures the count is greater than 0 before decrementing it
[14:24:42] <Nilshar> Hum... I see..
[14:25:40] <Nilshar> will try a few things on test cluster then... but sadly I got this "issue" (it's not really one but...) on prod clusters..
[14:25:41] <Zardosht> so yea, to summarize, the command replSetMaintenance will increment when true, decrement when false, and if that command runs with false multiple times without having a corresponding run with true, I think the count can get negative.
[14:28:03] <Nilshar> Zardosht: thank you, make sens, so probably a bug, but should not be too bad... and will probably goes away on upgrade
[14:41:03] <Nodex> very windy today
[15:17:49] <ggherdov> Hi all. I am about to click "buy" for "mongodb applied design patterns" http://shop.oreilly.com/product/0636920027041.do given that's my first text on mongo, am I making a good choice?
[15:37:23] <progolferyo> I'm trying to profile a secondary in a sharded cluster and I'm trying to just log every request coming in for a brief period of time. does anyone have any idea why its not logging. I'm calling db.setProfilingLevel(2); and then looking here, db.system.profile.find().sort({$natural:-1}).pretty(); but its just not recording the queries coming in
[15:38:27] <stevie-bash> Hello
[15:39:26] <stevie-bash> Where are the querys stored, if you are using mongos router and a client with Safe=false write concern set? Does the router cache this querys in the memory?
[19:45:01] <halfie> posts.find({"author": "Mike"}) <=== how do I get a list of all"author" values? will aggregation help?
[19:47:08] <kali> halfie: distinct for very simple needs on trivial setups, aggregation framework otherwise
[19:48:47] <halfie> kali, thanks! distinct works fine.
[20:47:14] <Altonymous> I am having a problem setting the ulimits for mongod I have updated my limits.conf file but when I use the bash file for return-limits mongos it stills returns the 1024 value instead of the new value I've set?
[20:49:16] <saml> yo
[20:49:25] <saml> is there jcr implementation on top of mongodb?
[20:49:27] <Altonymous> I'm not sure how to check mongodb ulimit, but my user is showing the correct number.
[20:49:36] <saml> cauze jackrabbit craz
[20:49:51] <saml> takes mintutes for lock to be released on concurrent writes
[20:50:02] <saml> does mongodb have concurrent write/read problem?
[21:30:15] <oskie> Altonymous: I had the same problem. sometimes it worked for me, sometimes it didn't. I placed the rules in some file in /etc/security/limits.d and rebooted the system