[06:43:26] <amitprakash> Hi, why is an UnorderedBulkOp() crashing on errors (duplicate _id) instead of trying the other records?
[07:19:32] <Boomtime> amitprakash: do you mean "crashing" to mean you failed to catch the exception that the driver raised? or something else?
[07:19:37] <quincylarson> Question: I am running MongoDB in production on a digital ocean instance. I was trying to connect to it with mongohub and it connected, but it stopped responding to production traffic
[07:20:14] <quincylarson> Is there a safe way to connect remotely without distracting MongoDB from responding to traffic?
[07:21:26] <Boomtime> quincylarson: it sounds like mongohub might have gone a bit rogue, a coincidence in timing, or some other thing occurred
[07:21:29] <amitprakash> Boomtime, I mean it does not seem to attempt any other record in the bulkOp
[07:21:49] <Boomtime> mongodb can't ever possibly judge the intended difference between two clients
[07:23:42] <Boomtime> amitprakash: with unorderedbulkoperation there isn't any real definition of what is the 'next' operation so i'm not sure how you are seeing what you claim
[07:25:14] <Boomtime> the operation, the entire bulk object, is funamentally flawed
[07:25:27] <Boomtime> there is no point in doing any of it
[07:25:46] <amitprakash> Boomtime, the errors occur when a document on serverA has a duplicate with an existing document on serverB i.e. doc(serverA)._id == somedoc(serverB)._id
[07:26:11] <amitprakash> Boomtime, there are no duplicate _ids in the operation itself
[07:26:13] <Boomtime> how does that lead to the same _id in a single bulk op?
[07:26:26] <amitprakash> sorry, i misunderstood the question
[07:26:49] <Boomtime> driver? code snippet to some pastie site please!
[07:27:01] <amitprakash> Boomtime, the way I am ensuring that the operation is crashing is by looking at record # on server B which does not increase at all since the crashes started
[07:27:18] <Boomtime> uh-huh.. maybe do some better debugging
[07:27:25] <Boomtime> that sounds like you are guessing
[07:28:03] <amitprakash> not really.. I also ended up throwing all _ids in bulkOp and I know for sure some of those should have been moved
[08:08:58] <Boomtime> amitprakash: not sure what is going on there, i'd have to do some tests
[09:05:39] <amitprakash> Hi, How is this statement supposed to work? results=bulkop.execute(function(err,result) { console.log(JSON.stringify(result));});
[09:05:52] <amitprakash> Since bulkop.execute only takes writeConcern as a parameter
[09:14:19] <nalum> hello all, is it better to use $or or $in on a single field?
[12:04:51] <velikan> how to db.collection.group a datetime field by date?
[12:09:53] <aps> I think I've screwed up big time and would highly appreciate some help here.
[12:09:53] <aps> I added auth to my mongo replica set few days back and created a user with roles: [ { role: "root", db: "admin" } ], Now I'm need to unable to rs.add( ) new member to replica set - reason "not authorized on local to execute command". The new member has same keyfile.
[13:06:54] <deathanchor> soo... aggregating too much I guess: request heap use exceeded 10% of physical RAM
[13:07:34] <barbagianni> Does not help, but I think I'm on to something
[13:07:51] <StephenLynx> what error does it throws?
[13:08:11] <StephenLynx> function x(){} x(); is valid on io.js
[13:08:15] <deathanchor> I can't bump up the memory anymore, anyway around this other that making more filters to limit how much data it is aggregating?
[13:12:37] <barbagianni> Thanks for the help, StephenLynx
[13:18:09] <deathanchor> even to a secondary though?
[13:39:08] <deathanchor> eh, just added a { $limit : 40000000 } to the start of my aggregation since it's only for some statisical general info
[13:59:10] <bogn> Hi all, I'm about to move a 164 GB database. Is mongodump & mongorestore suitable for that or should I just copy the db folder? It's also a move from 3.0.1 to 3.0.5 that shouldn't be an issue?
[14:01:56] <deathanchor> bogn: if you stop mongod, then you are safe to do an rsync of the dbpath
[14:02:43] <deathanchor> if it is local network I wouldn't bother with compression and just use rsync -avP
[14:04:06] <deathanchor> well depending on your throughput I still wouldn't compress, I have done an rsync -avP over wan and it was still faster than using -azvP
[14:04:51] <deathanchor> straight up rsync of the dbpath will be faster than a mongodump,rsync,mongorestore.
[14:05:01] <deathanchor> it won't even need to rebuild any indexes
[14:12:54] <kali> Kosch: nope. initiate() must only be run on the member that has the initial data
[14:12:57] <bartzy> Kosch: According to this tutorial, no : http://docs.mongodb.org/manual/tutorial/deploy-replica-set/
[14:14:00] <bartzy> if we’re on replication… I had a replica set which I turned into a single server (don’t ask…). Now I want to create a replica set again. What do I need to do on the single server (which was part of a replica set before) ?
[14:14:11] <bartzy> Should I drop any oplog collections or something?
[14:14:32] <Kosch> bartzy: yes, I wasn't sure about the preparation of the additional members.
[14:15:23] <Kosch> kali: so additional members stay in empty config state, until they are added.
[14:17:35] <kali> Kosch: you should not have to connect manuall to the additional members.
[14:19:14] <deathanchor> new replSet gist: standup mongo on all machines, mongo on primary (with data) rs.initiate(), then rs.add() the other members, done!
[14:19:16] <bartzy> Derick: Sorry to bother you, but perhaps you know or can point me in the right direction. I had a replica set on 2.4 (2 data nodes, one arbiter), and I upgraded to 2.6. After around a day (with no issues), the mongod process crashed after the following log: warning: DR102 too much data written uncommitted 314.978MB
[14:19:42] <bartzy> 500ms after that, the log stated: Assertion: 10345:passes >= maxPasses in NamespaceDetails::cappedAlloc: ns: local.oplog.rs, len: 148332, maxPasses: 5000, _maxDocsInCapped: 2
[14:24:18] <bartzy> Derick, deathanchor : I’m on 2.6.11. It’s not the former set - That’s what caused the set to become “former”.
[14:24:22] <kali> bartzy: that's the spirit. ditch "local"
[14:24:39] <bartzy> It happened over and over - It promoted the secondary, then after a few minutes it happened on the secondary..
[14:25:01] <bartzy> Until I got this one just before the stack trace: SEVERE: Fatal DBException in logOp(): 10345 passes >= maxPasses in NamespaceDetails::cappedAlloc: ns: local.oplog.rs, len: 148332, maxPasses: 5000, _maxDocsInCapped: 2147483647, nrecords: 347811, datasize: 10035458332
[14:25:32] <bartzy> kali: Thanks. Will do. I hope I won’t encounter that crash again. I fear the perhaps it was due to data curroption - is that possible..?
[14:25:46] <bartzy> The entire setup worked flawlessly for 2 years on 2.4 :|
[14:26:24] <kali> bartzy: well, there is something wrong somewhere. all bets are off
[14:26:28] <Kosch> deathanchor: kali: maybe its related to my setup. I've two separate machines. on both is running mongod on localhost:27017. To get them see each other I use a tunnel. I can imagine that confuses replication setup, when having multiple hosts with "localhost:27017" as name...
[14:26:45] <bartzy> kali: I didn’t find anything on that DR-102 warning.
[14:27:55] <kali> Kosch: that would definitely confuse mongodb. replication needs to have meaningfull hostname for the whole setup, including client apps
[14:27:59] <deathanchor> Kosch: if you want to use localhost then you would need to setup tunnels to various ports so that the tunnels on the ports point the right machines.
[14:28:20] <bartzy> kali, deathanchor: My app saves images as binary data in regular collections. The images are 50-300KB, not huge. Perhaps 2.6 exhibits some other journal performance characteristics than 2.4, which caused some weird “uncommited” problem?
[14:28:34] <deathanchor> Kosch: kali is also correct, your clients will never know who to talk to
[14:29:29] <bartzy> There’s another thing to note in the upgrade - I almost never got slow queries for this images collection (>100ms). Now I get a few updates that are 100ms-800ms almost every few minutes.
[14:29:48] <Kosch> deathanchor: in my case the client runs on every host, so they are talking only to db on localhost.
[14:29:52] <bartzy> that’s what caused me to think that maybe something has changed internally in 2.6 regarding performance of larger documents …
[14:31:29] <Kosch> deathanchor: but yes, I've to find another way. root cause of this situation is just the lack of ssl support in the official non-enterprise packages. I wanted to avoid rebuild them by my own :)
[14:37:16] <bartzy> kali: About breaking the mirror - I have to shutdown the single server in order to move the local database?
[14:42:03] <bartzy> I wonder if the 2nd option isn’t better suited for my situtation? https://docs.mongodb.org/manual/tutorial/reconfigure-replica-set-with-unavailable-members/#reconfigure-by-turning-off-replication
[14:42:19] <bartzy> I mean, that’s exactly what I did. But now there’s this part: When possible, re-deploy a replica set to provide redundancy and to protect your deployment from operational interruption.
[14:42:49] <bartzy> But how do I “re-deploy" when the single server WAS a replica set member…
[14:52:46] <bartzy> kali: If I stop the single server now, start if with the replSet option, will it still be “primary”? Meaning it will accept writes and reads?
[14:52:55] <bartzy> kali: Or will it become secondary and not want to promote
[14:53:32] <kali> bartzy: it will be operational when the rs.initiate() command is issued, after the start
[14:53:54] <kali> step 5 on the "breaking the mirror" procedure
[14:54:01] <bartzy> kali: so before rs.initiate() in what state is it going to be? And after, it is going to be primary?
[14:54:32] <kali> yes. after step 5, it will become primary
[14:54:44] <bartzy> kali: I think “breaking the mirror” does not apply directly to me - since I also need to set the —replSet option on the single server - it is not enabled now on the working server.
[14:55:07] <bartzy> so I need to stop the server , move the local database, AND start it with —replSet, correct?
[14:55:37] <kali> yes. and run rs.initiate() on it ASAP so it will elect itself
[14:56:03] <bartzy> ok, and then if clients have only that one server configured - they will connect without issue? Even if they have no “replSet” configured in their connect options?
[14:56:22] <bartzy> or do I need to time a deploy for the clients so they will have replSet in their connect options as well..
[14:57:01] <bartzy> OK. So only after the replica set is whole again, I will deploy the replSet option to the clients.
[14:57:23] <bartzy> kali: Last questions - one of the members is an arbiter - The procedure is the same for that as well ? (Moving the entire data directory)
[15:01:54] <bartzy> The init.d script takes care of backgrounding
[15:07:15] <bartzy> kali: Really last question - I want to run repairDatabase to see if perhaps the performance issues (not related to the replication config) are somehow related to fragmentation…
[15:07:31] <bartzy> it won’t be necessary on the newly synced member, right?
[15:07:54] <bartzy> Since it writes everything from scratch (syncs from the current working node)
[15:09:30] <kali> bartzy: no need to repair after a resync.
[15:10:09] <bartzy> kali: and the current one will need the repair right? And I can do that by promoting the new one to primary, and then repairing the current (which will be secondary)
[15:10:47] <kali> bartzy: yeah, or alternatively, promote the new node, then scratch the old one to trigger a full resync
[15:14:58] <und1sk0> got a nasty segfault, can't find anything about it in JIRA..
[15:14:58] <kali> once you have the replica set up and running, you can have the clients configured to the replica set, including all its nodes. when one node is not available, the clients will try another one
[15:15:35] <kali> bartzy: and yeah. repair VS resync, the outcome should be identical
[15:15:48] <bartzy> kali: OK. One more question - when specifying a node with rs.add(), is it safe to use the hostname without the domain (for example, storage-02:27017 instead of storage-02.internal.prod:27017) ?
[15:16:19] <bartzy> of course the resolver configuration sets the search domain to internal.prod on all servers…
[15:16:36] <kali> bartzy: you just need to make sure everybody involved in the setup (mongodb nodes and clients) will be able to resolve correcyly these names.
[15:16:58] <und1sk0> bartzy: i use short hostnames, i think just as long as your config, shard and replica set memebers can all resolv those names you're good
[15:20:51] <kali> und1sk0: jira server, then, i guess
[15:21:12] <und1sk0> kali: thanks... i'll keep an eye on irc in case anyone has an insights
[15:21:46] <bartzy> kali: It’s syncing :D I added the arbiter first and then the second node. And now the arbiter is _id:1 and the 2nd node has _id:2. Bothers my OCD :o
[15:21:57] <bartzy> can I change that without too much hassle?
[20:53:21] <bogn> Hi all, when moving the data directory of a standalone node from one host to another, do I need to copy the journal and _tmp directories as well. It's also a move from 3.0.1 to 3.0.5
[20:55:29] <bogn> Forget about _tmp, it's empty. But the journal is 1.7 GB in three files.
[21:27:00] <domo> does findAndModify block reads while finding?
[21:40:58] <jpfarias> for a collection with 110 million documents and 216GB of data, what would be a good number of shards, assuming each shard has 16GB of memory
[22:25:21] <jpfarias> the index was created with: db.transactions.ensureIndex({‘tags’: 1})
[23:11:55] <energizer> Hello, new to mongodb, I hope you can help me. I have a python dictionary of Member objects, which are themselves dictionaries . I'd like to go through the dictionary and at each Member object, insert it into mongodb if its 'id' is not in the db. If its 'id' is in the db, i'd like to update the fields that are present in the dictionary. This seems like it should be easy to do, but i can't seem to figure it out.
[23:28:36] <daidoji> set the query parameter "upsert": True
[23:32:31] <energizer> daidoji: Thanks for responding. What concerns be about that is: for Members whose 'id' values are present in the db I don't want to erase any fields that are not present in the dictionary.
[23:32:42] <slackorama> energizer: use '$set' if you only want to update specific fields (rather than a new document).