[06:58:29] <rspijker> d-rock1: had to leave yesterday, did you manage to find out what was going on with the hidden collections?
[08:02:33] <movedx> Once sharding has been enabled, can it be disabled later on?
[08:03:02] <movedx> SO if I enable sharding on an existing collection, one which is growing in size now, and then need to rollback during the maintenance, can I do so?
[08:24:45] <movedx> Wow. OK. Yeah that's... steps... a lot of :P
[08:26:12] <rspijker> you shoul really make your shards replica sets… Then you can actually do maintenance...
[08:27:09] <movedx> They are already, now that I think on.
[08:27:48] <rspijker> So just use rolling maintenance :)
[08:28:36] <movedx> Yeah I'm new to this stuff, so I'm trying to get my head around the architecture.
[08:31:34] <movedx> rspijker: Can you explain the steps involved in that? I will review the architecture of this cluster now.
[08:33:24] <rspijker> well… if your shard is a RS, you can just bring down each secondary and the shard will continue to function fine. You perform maintenance on the secondary and bring it back up. Repeat for each secondary. Then you step down the primary, it becomes secondary and you do the same thing to that. Then you’te done. Maintenance performed on all nodes without a second of downtime
[08:34:40] <rspijker> for this to work properly (and you to have actual guarantees about data retention etc. you need 2 real secondaries in each RS)
[08:34:44] <movedx> Right, OK. SO I'm going to login to the system now and determine primaries/secondaries, etc.
[08:37:14] <movedx> rspijker: It looks like we have two shards with three replica sets.
[08:38:28] <rspijker> 2 shards which each are replica sets with 3 members?
[08:38:56] <movedx> I think so? We have Shard 1, Server 1, 2 and 3. Then Shard 2, Server 1, 2 and 3.
[08:39:05] <movedx> Someone else set this up, and I've enver done Mongo stuff really.
[08:39:38] <movedx> So I assume the servers are replica sets?
[08:39:56] <rspijker> they are replica set members, most likely, yes
[08:42:46] <movedx> rspijker: So for each "secondary" (Server 2 + 3), I take them out the cluster and then follow joannac's steps?
[08:43:02] <rspijker> no. You don;t need joannac’s steps
[08:43:24] <rspijker> if you just want to perform maintenance on the hosts, you don;t have to remove the entire shard
[08:44:18] <movedx> OK, sorry I'm confused. I thought what you were recommended was supplementary to what joannac was suggesting. How do your steps reduce a sharded collection to a non-sharded collection?
[08:44:54] <rspijker> they don’t… that was the entire point
[08:45:24] <rspijker> why would you want to unshard for maintenance?
[08:46:03] <movedx> Sorry, I never clarified "maintenance." So we have unsharded collections which we want to shard.
[08:50:50] <Katafalkas> Deploying 3 config servers for production - they guide says that http://docs.mongodb.org/manual/tutorial/deploy-config-servers/ i just start it with 'mongod --configsvr' all three of them ... does this mean that the config servers are not in replica set ?
[08:51:26] <Katafalkas> lets say if later I would like to increase the size of one of the config servers ... how do I add additional config server replica member ?
[08:52:04] <Derick> right, config servers are not a replicaset
[08:52:16] <Derick> (or 1, but not for production)
[08:53:09] <Katafalkas> and if later in production i decided to increase the size if config servers ? is there a nice way to migrate ? like adding replica set member ?
[08:53:37] <Derick> you just need to shut one config server down
[08:53:53] <Derick> replace it --- potentionally on the same IP address and bring it up
[08:54:12] <Derick> if there are no 3 active config servers, mongodb can't migrate chunks though
[08:54:20] <Derick> but why would you make a config server larger?
[08:54:59] <Katafalkas> and the data chunks will syncs between servers ?
[08:55:52] <Katafalkas> we are starting project. so i dont want to get like xlarge servers for config servers, would like to get a micro maybe or a small servers
[08:59:21] <movedx> rspijker: Sorry had a meeting. So we have unsharded collections, now reaching 10s of GBs in size, so we want to shard them. We need a regression plan should things go south.
[08:59:37] <movedx> rspijker: SO after creating the index, I will then able sharding etc.
[08:59:55] <movedx> rspijker: So I need a regression plan to rollback the sharding in the event something fails or stops working.
[09:00:01] <rspijker> movedx: that’s what joannac suggested. That is in no way maintenance though…
[09:00:35] <movedx> rspijker: It's a maintenance in ITIL terms. Perhaps MongoDB has its own definition, but it is a maintenance in... the entire IT industry ;)
[09:01:51] <Nodex> it's normally called a migration but that's potatoes
[09:03:51] <Nodex> regression is easy. Take a snap shot, if all fails then remove the shards and put the snapshot back
[09:03:55] <rspijker> maintenance, to me, is the act of keeping something maintained. As in, keeping it in good condition. What you are doing isn’t that…
[09:04:01] <Nodex> don't need an ITIL piece of paper for that ;)
[09:08:02] <movedx> So going off of joannac's instructions (and not bickering about the definition of an industry standard term), I should basically removeShard() on the replica servers (the non-primary ones for that shard) and then movePrimary() those shards to a single/current primary?
[09:09:39] <movedx> Why have I got to shutdown the mongoS instance and config servers after doing this?
[09:12:23] <Nodex> movedx : just a quick point on your "industry standard term" comment. I have been in the industry for a very very long time, I have never even heard of ITIL until today, also the (proper) definition from the dictionary of "maintenance" is closer to what rspijker stated which is what most "normal" people would also think of making certain questions ambiguous if you're throwing these terms
[09:22:12] <Nodex> take a dump, shard, if sharding fails then remove the shards and restore the dump
[09:22:26] <Nodex> it doesn't get simpler than that
[09:23:39] <crs_> Hello All. A quick question. I am trying to insert a json file into mongodb. Everything seems to be working fine except the date. It is getting stored as string. This is the sample json {"d":{"t":"2014-07-24T01:00:00Z"}}. I read that by making this as {"d":{"t":new Date("2014-07-24T01:00:00Z")}} it will work fine. But is this the only way to insert a json date into mongodb?
[09:24:27] <Nodex> there is no such thing as a json date
[09:28:28] <rspijker> and yes, afaik that’s the only way to insert a date through JSON
[09:29:04] <rspijker> http://stackoverflow.com/questions/12186006/inserting-json-into-mongodb-converting-dates-from-strings-automatically this might be useful though crs_
[09:29:07] <movedx> Nodex: So these steps: http://docs.mongodb.org/manual/tutorial/manage-sharded-cluster-balancer/#disable-the-balancer
[09:36:44] <Nodex> well that's a lie, you can setup a single instance to accept the writes and read from a replica set then migrate the new writes into the new cluster
[09:37:05] <Nodex> seems like a lot of effort to avoid ~20 mins downtime
[09:37:29] <rspijker> Why are you assuming it goes belly-up? And, in the case that it does that the answer is to just stop sharding altogether and go back to unsharded operation?
[09:38:30] <movedx> rspijker: All other suggestions are welcome. ANd I believe having a plan to deal with failure is a good idea - you disagree with this? I shouldn't plan for this going wrong due to a bug or incorrect operation on the data?
[09:39:45] <arussel> I'm starting mongo using: mongod --dbpath, is there any option I can set to see all queries being ouput ?
[09:42:13] <Nodex> you can raise the profiling level to 2 and tail the log
[09:45:38] <rspijker> movedx: having a disaster recovery plan is good, of course. However, this isn’t that.. You are considering implementing a certain ‘technology’ or way of operating and are planning against that not working. In my opinion that’s not a decision you make on a production system. You test it on a copy of your data in a staging set up and if it all works out well there, then you can start using it in production. You are attempting to
[09:45:39] <rspijker> apply a mechanism you would use for dealing with bugs as a way to decide which technologies and techniques to use in your system. That won't end well.
[09:45:47] <arussel> Nodex: wouldn't that be in the output of mongod --dbpath ?
[10:06:24] <rspijker> joannac: I have to admit I’ve not read it anywhere official. Only in comments in mulitple places (e.g., on here https://jira.mongodb.org/browse/SERVER-1794). So not sure whether it’s the actual truth or just a repeated misconception
[10:08:17] <joannac> rspijker: I've seen super long log lines so my gut feel is it's bigger
[10:08:24] <joannac> but now I'm doubting myself ... :(
[10:08:41] <rspijker> joannac: you might very well be right… I think I’ve seen longer ones as well...
[10:08:54] <rspijker> also not sure whether the 256B only applies to currentOp() or also to logging
[10:42:28] <dawik> hmm, then why would it be stored on disc?
[10:43:11] <dawik> even if it were pre-allocated it would need to allocate more (and free memory at times) you would think
[11:01:54] <Nodex> the space is pre-allocated to ensure things try to sit next to each other on disc to avoid massive disk seeks
[11:35:11] <rdsoze> Is it true that $exists doesn't use an index ?
[11:35:47] <rdsoze> Found a SO question which references to older docs stating the same: http://stackoverflow.com/questions/9009987/improve-querying-fields-exist-in-mongodb
[11:35:55] <rdsoze> Can't find anything about it now
[11:46:13] <rdsoze> Anyone has insights on using $exists with indexes ?
[12:04:26] <joannac> actually, looks like it worked in 2.4 too?
[12:05:46] <rdsoze> joannac: My queries using $exists have slowed down significantly as the collection size has increased. Will using a sparse index here help ?
[14:43:18] <remonvv> Anyone aware of why arrays are stored as index keyed maps in BSON. Always struck me as odd.
[14:44:54] <kali> remonvv: simplifying the implementation ?
[14:45:41] <remonvv> kali: That's my theory. It's not a particularly convincing one though. We're doing something where we store quite a bit of integers in an array and the size overhead is dizzying.
[14:45:59] <remonvv> kali : What I mean is, is it actually more simple?
[14:46:32] <rspijker> kinda.. It’s saying an array is actually a very specific instance of this underlying thing we already have all of the helper methods for...
[14:47:12] <rspijker> what kind of size overhead are we talking here?
[14:50:41] <remonvv> The optimal way to store an array (int array in this example) is 1 byte for element type, 4 bytes for array size, and 4 bytes per value.
[14:56:24] <remonvv> And for the additional optimization of "this is an array of type X" as I mentioned it'd need some sort of optional strict typing check.
[14:56:41] <remonvv> Oh well, food for thought I suppose.
[15:01:03] <remonvv> Hm, so an int array with a single value in current BSON is 1(type == array) + 4(docsize of array) + 1(cstring element type) + 2(smallest cstring key) + 1(x10 integer element type) + 4(integer value) + 1(0x00 doc terminator) = 14
[15:17:52] <Derick> plowe: in that way, yes - set can only update *one* field. In your case, you need to do it client side (but you lose atomicity of the update)
[15:18:45] <rspijker> remonvv: that’ll be a cheap session: http://www.ebay.com/itm/Was-Opened-FERRARI-F355-SPIDER-BLACK-1-18-DIECAST-MODEL-CAR-BY-HOTWHEELS-/141353645345
[15:46:12] <fontanon> Hi everyone, I'm looking for some advice on mongodb design patterns. Lets suppose I've a mongodb collection for storing a timeline of events, i mean, with a timestamp each. For example, a phone call registry. A requirement of the app using this mongodb collection is: displaying the last call per phone number with the sum of the call durations. Which design pattern makes more sense? [Design pattern 1] The app make a queries with the agg
[15:46:12] <fontanon> regation framework to calculate the sum of call-durations and returns it attached to the last phone-call (sort by timestamp:-1). [Design pattern 2] To keep a separate collection with one record per phone number. On each new phone-call, do mongodb findAndUpdate on the proper record.
[15:47:33] <Derick> I'd do: store an entry for each call in one collection *and* store an entry for each phone number in another containing the number, and the sum-of-calls
[15:47:48] <Derick> upon insertion of the call entry, also update the phone number entry to add the new time
[15:48:10] <fontanon> Derick, more or less the design pattern 2.
[15:48:41] <Derick> yes, but keeping each single *entry* out of there
[15:48:48] <Derick> and no need for findAndUpdate either...
[15:49:46] <fontanon> Derick, how is the sum-of-calls calculated in that colletion? I've read something about some mongodb facilities to do this.
[15:53:13] <fontanon> this sounds awsome Derick, thanks !
[15:58:22] <d0liver> Hi, I'm relatively new to mongo. I'm trying to store a relatively small amount of binary data as a field on one of my collections. The field is the binary data for a profile image. The data is being stored as a string for some reason. I can verify this with db.myCollection.find({imageBlob: {$type: 2}}). What do I need to do to make mongo store this as binary data?
[17:04:25] <s2013> does mongodb have limitation on the size of the collection being imported/exported?
[17:30:00] <in_deep_thought> Is there a mongodb equivalent of sqlite? like where the db can just be a file that you access?
[17:45:45] <zfjohnny> What can I add to my mongo.conf file iln order to get a full query profile log file in my development server?
[19:20:28] <zfjohnny> Is anybody in this room? Been monitoring for over an hour.. no messages
[19:24:01] <in_deep_thought> zfjohnny: I ask questions from time to time. I bet you are more interested in answer givers than question askers but here I am!
[19:38:51] <s2013> this is the least active out of any major tech channel ive ever seen
[19:51:28] <in_deep_thought> s2013: I think cause its friday.. Im not sure. usually has some activity
[19:59:00] <SubCreative> Running into an issue with making an update using $set, I have an object like so { user: "bar" details: { item1: "bar" }}
[19:59:31] <SubCreative> Every time I try to make an update to item1, if there are other items in the same object, it will remove all the others and only keep my updated item.
[20:37:03] <nicolas_leonidas> mn3monic, I'm a newbie sorry
[20:37:09] <nicolas_leonidas> what's wrong with dots?
[21:14:10] <leru> Hi. I have don't know anything of mongodb. Is it just like javascript but as an database?
[21:53:44] <mango_> I'm using MMS, and have 'Host is unreachable.' I've just started my MongoDB server, how do I verify the connection again?
[22:18:14] <mango_> Anyone out there help with a MMS issue?
[22:25:36] <AlexZanf> hey guys I have a user model, and i am trying to add profile images to users. Should i just add a images[int,int] list to the user model? with the first param being the image slot, and the 2nd param being the image name or id? or should i make a new image model and compose with it?