PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Tuesday the 8th of November, 2016

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[02:24:34] <cornfeedhobo> cheeser: so, not to sound negative, but are the only one answering questions?
[02:24:52] <cornfeedhobo> are you*
[02:30:12] <cheeser> cornfeedhobo: no. it varies by time of day, week to week, etc.
[02:55:35] <ghadi> Hi folks. Are there any successful prod deployments of Mongo on btrfs filesystems here?
[04:59:17] <energizer> I have a web scraper that checks a bunch of pages, case numbers A1-A1,000,000, B1-B1000000, ... . If there's a page for that case number, save its data in my mongodb. Otherwise, move on to the next case number.
[04:59:17] <energizer> If I stop the program in the middle, i'd like it to be able to pick up where it left off, even if the last 100 cases it checked were empty, and therefore aren't in the db.
[04:59:17] <energizer> How should I keep track of the checked case numbers? Insert empty documents with just the case number into the collection? Another collection to store just the latest one tested for each letter prefix?
[05:48:47] <Jonno_FTW> anyone in?
[08:45:09] <deever> kali: so i can't directly upgrade 2.6.x to 3.2.x? this is a problem because i'm using freebsd and they don't provide any 3.0.x packages. how long is 2.6.x maintained?
[08:46:59] <kali> deever: i'm not sure. don't assume the required one is the one with the major version are they are not semver. you need to check the release notes, they state very clearly from what version you can bump
[08:51:00] <deever> ok, only direct upgrades are poosible
[08:51:38] <deever> anyone here knows the/a EOL date for 2.6?
[09:26:18] <energizer> Python 2.6.9 is the final security-only source-only maintenance release of the Python 2.6 series. With its release on October 29, 2013, all official support for Python 2.6 has ended. Python 2.6 is no longer being maintained for any purpose.
[09:26:22] <energizer> https://www.python.org/dev/peps/pep-0361/
[09:26:28] <energizer> deever: ^
[09:42:25] <deever> energizer: huh?
[09:43:28] <energizer> deever: i thought you asked the EOL date for 2.6?
[09:44:30] <energizer> oh, wrong thing, mongo, not python sorry
[09:45:09] <deever> energizer: ;)
[10:08:25] <kurushiyama> deever It already is at EOL.
[10:08:30] <kurushiyama> deever https://www.mongodb.com/blog/post/mongodb-2-6-end-of-life
[10:43:54] <deever> kurushiyama: will there be some support for 3.0 on freebsd?
[10:55:45] <kurushiyama> deever By the Inc? I doubt that. And although I like FreeBSD, I am not too convinced that it is a good choice for running MongoDB in production.
[11:39:18] <deever> kurushiyama: why not? ;)
[11:41:49] <kurushiyama> deever Well first of all, you are doomed to xfs (not a bad choice in itself) if you want to stay on a supported (aka tested) file system. Newer versions of ext4 seem to exceed xfs in performance when it comes to MongoDB.
[11:43:08] <kurushiyama> deever Second: You might run into problems, and you really want to be able to call in professional services. I am not sure wether Inc would support FreeBSD, but even if they did, their experience would be much more Linux-based.
[11:45:07] <kurushiyama> deever Third: Depending on what you do and who your customers are, you want to have a certification chain (OS, DBServer, maybe even application server if applicable). Already pretty hard to get for Linux, but afaik basically impossible for FreeBSD.
[11:46:18] <kurushiyama> deever In sum, there is little to no advantage for running it on FreeBSD other than personal preference, but quite some disadvantages in quite common scenarios.
[11:46:42] <kurushiyama> deever Does that answer your question?
[11:49:58] <deever> kurushiyama: yap, indeed! ;)
[12:31:38] <marianogg9> hi guys, i've cloned a working mongo 3.0.9 into other instance (aws), running the same hardware, same resources, same app app consuming/querying, now queries take up to ~600 secs in this new instance, when they should (and do) take around 100ms in the working environment
[12:32:46] <marianogg9> single deployment, no replica, no sharding, no tune, just installed and up in both scenarios, same resources, same hardware, same OS (centOS7), same dataset, same app, same queries
[12:33:32] <marianogg9> and load goes up to 9 in the new one, while load is stable at 0.5 in the working one
[12:34:44] <marianogg9> i'm looking for a hint or somewhere I could take information from, like profiling (done that) or debugging logs (done that), query explain (also done), there're no errors at sight, it's just taking much longer
[12:38:08] <whirlibulf> what happens if I have an even number of servers in a replica set?
[12:41:59] <kurushiyama> whirlibulf Let me dig an explanation up.
[12:42:34] <kurushiyama> whirlibulf For starters: http://stackoverflow.com/questions/25502410/two-nodes-mongodb-replica-set-without-arbiter/25515526#25515526
[12:43:29] <kurushiyama> whirlibulf So, lets say you have two members. Of two, the _qualified_ majority is 2.
[12:44:35] <kurushiyama> whirlibulf Now, if one node fails, the other one checks for votes, finds out that a qualified majority can not be reached and reverts back to secondary state - eliminating the possibility to write.
[12:44:58] <kurushiyama> So, let us increase the number to 4.
[12:48:18] <kurushiyama> whirlibulf Of which the qualified majority would be 3. One node fails, no problem. Two nodes fail, and again a qualified majority can not be reached. So you are paying for 4 nodes, while two nodes failing will revert your replica set to secondary state. With a simple arbiter, which will only cost a fraction of a data bearing node, you could prevent that and actually afford 2 data bearing nodes failing out of your 4.
[12:48:49] <kurushiyama> whirlibulf Or, to put it another way: with 4 nodes, you actually have the same redundancy as with 3 nodes, only that you pay one node more.
[12:49:16] <kurushiyama> whirlibulf Does this answer your question?
[12:50:09] <kurushiyama> marianogg9 Please specify "clone".
[12:50:45] <kurushiyama> marianogg9 I suspect missing indices.
[12:51:16] <marianogg9> kurushiyama: clone as in installed a new mongodb server, compressed all /mongo and then uncompressed in the new instance
[12:51:31] <marianogg9> i've checked on collection indices and they're there
[12:51:32] <whirlibulf> kurushiyama: yes thanks
[12:52:46] <kurushiyama> marianogg9 Have you had a look at the logs? How about file system permissions?
[12:52:55] <whirlibulf> is there any advantage then to having more than 3 nodes in a replica set?
[12:52:56] <kurushiyama> whirlibulf You are welcome.
[12:53:13] <kurushiyama> whirlibulf Other than more nodes that can fail? No.
[12:53:41] <marianogg9> kurushiyama: yes I have, this query fails in just one collection, other ones are being done just fine
[12:54:59] <marianogg9> permissions are correct and I've rerun the rsync several times
[12:55:12] <kurushiyama> marianogg9 What rsync?
[12:55:33] <marianogg9> copied the /mongo over to the new instance
[12:56:40] <marianogg9> also, run with --repair flag in order to avoid any inconsistency, and logs show a correct data recovering
[12:57:46] <kurushiyama> marianogg9 I'd use proper tools for the job: mongodump | mongorestore
[12:58:39] <kurushiyama> marianogg9 That is calling mongodump on the new instance with the url of the old instance, and piping the result into mongorestore accordingly configured.
[12:59:02] <kurushiyama> marianogg9 Add pv into the pipe to your liking.
[12:59:57] <kurushiyama> marianogg9 I assume you had both MongoDB instances shutdown during the transfer?
[13:02:49] <marianogg9> kurushiyama: i've done this same process many times before, just copying over /mongo dir; never got an error
[13:03:32] <kurushiyama> marianogg9 Check the system clock.
[13:03:39] <kurushiyama> marianogg9 Seriously.
[13:03:48] <kurushiyama> marianogg9 And the time on the files.
[13:07:42] <marianogg9> files are mostly from nov 2 and ```# date Tue Nov 8 12:52:41 UTC 2016```
[13:14:54] <marianogg9> anyway, after mongodump/restore shouldn't the indices be re-created?
[13:16:55] <cheeser> yes
[13:20:22] <marianogg9> it's not an option to have origin mongoDB stopped, it's a prod environment
[13:21:00] <cheeser> to properly take a snapshot, you'd have to lock down that machine
[13:21:06] <cheeser> or dump from a secondary
[13:32:30] <marianogg9> cheeser: i'll try to do that and see how it goes
[13:37:27] <cheeser> mongodump will take out a lock so that secondary will stop syncing. that lock might yield so it might not be that catastrophic, though.
[13:37:56] <cheeser> if it yields you might get an inconsistent dump (an already dumped document might be updated behind you...)
[13:38:05] <cheeser> for testing purposes that's probably fine.
[13:48:56] <marianogg9> this is a single instance deployment, no replica or sharding
[13:50:01] <cheeser> for production? bold choice.
[14:17:23] <kurushiyama> marianogg9 We are talking of memory mapped files. In order to have a consistent copy, stopping is mandatory. As per the time: it is a wise decision to have ntpd on both the client and the servers. Time deviances can lead to.... interesting behavior. And I could not agree more with cheeser that given the prices of today, running an prod database standalone is a bold choice, in his words. In my book, that is bordering neglegence.
[16:12:27] <qswz> this http://vpaste.net/0KXjo should work right?
[16:12:33] <qswz> if I understand sparse indexes
[16:12:37] <qswz> but it doesn't
[16:13:16] <qswz> or maybe the validator is conflicting with it
[16:15:23] <qswz> hmm $regex is not working with empty field
[16:17:42] <qswz> I can't put username: {$or: [{$exists: 0}, {$regex: /^[\w-]*$/}]} in validator
[16:17:49] <qswz> te $or must be top-level?
[16:20:33] <qswz> https://www.mongodb.com/blog/post/document-validation-part-2-putting-it-all-together-a-tutorial they wrote { price: {$exists: true}, price: {$type: 1} } .. that's not serious
[16:24:13] <qswz> http://vpaste.net/IjKWo works
[16:24:32] <qswz> but I don't understand why I cant put the $or inside, just for username
[16:26:21] <qswz> hmm {email: .., $or: [{ username: {$exists: 0} }, { username: {$regex: /^[\w-]{3,}$/} }]} works
[16:27:17] <qswz> username: {$or: [{$exists: 0}, {$regex: /^[\w-]{3,}$/}]} would have been fun, but i'll deal with tit
[17:23:57] <tenshihan> hi
[17:24:01] <tenshihan> guys I'm so fucked
[17:24:08] <tenshihan> some idiot at my work deleted a bunch of data
[17:24:24] <tenshihan> there _might_ be a back up I put in the request for one months ago but it's not my dept that handles it
[17:24:32] <tenshihan> I have the journals, it's percona rocksdb
[17:24:37] <tenshihan> is there any way to restore?
[17:50:13] <qswz> var [osinfo, networkInterfaces ] = yield* [sysinfo.osInfo(), sysinfo.networkInterfaces()]
[17:50:23] <qswz> oops
[18:08:07] <marianogg9> kurushiyama: well..i've done a backup by shutting down the db and then restored it in the new instance
[18:08:16] <marianogg9> same scenario than before
[18:45:50] <blizzow> I used mongochef to copy collections between a sharded cluster, and a replica set. Is possible to use mongo-connector to sync them up after the collections have been copied?
[18:46:34] <blizzow> I'd like to use mongo-connector to do the whole sync, but have been unable to get that to work.
[19:22:52] <qswz> it's recommended to not touch to _id?
[19:44:51] <marianogg9> once a query is received by mongo, it's logged right away or is it logged only if and when it's answered by mongo?
[20:10:20] <ironpig> Should $size work on an array that has keys set, so rather than being 0 - 2 the array has One, Two, Three?
[20:20:43] <GothAlice> ironpig: {one: "foo", two: "bar", three: "baz"} is not an array.
[20:20:47] <GothAlice> That's a document.
[20:21:17] <GothAlice> (So no.)
[20:25:39] <ironpig> ['one':'Y','two':'N','three':'N'] vs ['Y','N','N']
[20:32:16] <cheeser> the first isn't even json
[20:36:28] <ironpig> so I guess the real question is, can I use $size on an object ?
[20:37:38] <ironpig> ** reading the documentation. It looks like no.
[20:45:00] <cheeser> ok, then.
[21:14:51] <GothAlice> cheeser: Heh, without quotes around the attribute names / keys, mine isn't valid JSON, either. ;P
[21:28:36] <cheeser> well, mongo would accepts *that* :D
[21:32:27] <cpama> hi all. i have question about a full text search that i recently set up.
[21:32:45] <cpama> it no longer returns object ids as part of the result set
[21:33:24] <cpama> what's changed is that I'm now using a newer version of mongo. upgraded from 3.0.4 to 3.2.10
[21:33:58] <cpama> i also changed my driver from php mongo to php mongodb
[21:34:30] <cpama> the find command still works... no errors. But the result set is missing the object id for every document.
[21:35:24] <cpama> this is what the index looks like: http://pastebin.com/Mm6EL0Zf
[21:36:32] <cpama> my code in part... looks like this: http://pastebin.com/iC5xmZ19
[21:42:09] <qswz> Is it possible to update a field only if it doesn't exist in the document?
[21:42:24] <qswz> as part of a larger query
[21:54:06] <arduinoob> What is the maximum number of collections in MongoDB with WiredTiger storage engine?
[21:57:39] <arduinoob> I'm not really getting a good idea from the documentation if WiredTiger has no limits on the number of collections. Appears so https://docs.mongodb.com/manual/reference/limits/#Number-of-Namespaces
[22:57:30] <j4f-shredder> hey....I want to store the reference to an object ID in mongo of another collection....I'm using mongoose...which datatype should I use for that field?
[22:58:01] <j4f-shredder> var contribution = new Schema({ campaign_id: });
[22:58:20] <j4f-shredder> on the campaigns collection I have {__id: ...} as the default
[23:00:14] <j4f-shredder> ObjectId?
[23:14:39] <GothAlice> qswz: Welcome to the light side. ;)
[23:14:56] <qswz> yea :)
[23:15:16] <GothAlice> j4f-shredder: ObjectId. And make absolutely sure Mongoose actually saves real ObjectIds and not strings there.
[23:15:45] <GothAlice> (It has a tendency to treat IDs as hex-encoded strings… which don't compare the same against real IDs, causing many, many problems.)
[23:17:50] <GothAlice> qswz: As to your question, yes, but only sensibly if the whole update operation's purpose is to update that one field.
[23:18:18] <GothAlice> qswz: db.collection.update({field: {$exists: 0}}, {$set: {field: value}})
[23:18:46] <GothAlice> My DB migrations typically involve a fair amount of $exists querying. ;)
[23:19:08] <GothAlice> (Note that this is a slow operation; also filter on indexed fields to speed it up.)
[23:19:15] <qswz> oh thx, I did something like http://vpaste.net/rdYa9
[23:19:47] <GothAlice> Hmm. That's hard to grok.
[23:20:02] <GothAlice> Object.assign(data, user) returns the whole document, updated with the contents of `data`?
[23:20:16] <qswz> Object.assign 'merges'
[23:20:30] <qswz> and overwirting old data on new data
[23:20:40] <GothAlice> That's weird, man, since MongoDB updates already do that for you. ;)
[23:20:51] <qswz> it does the opposite
[23:20:56] <qswz> new data over old data
[23:21:33] <GothAlice> "returns the whole document, updated with the contents of `data`" is logically identical to "merging". Same thing.
[23:22:04] <qswz> it's a bit weird, that function is for signing with OAuth
[23:22:22] <qswz> if it finds an existing email, it'll try to not change existing fields
[23:22:26] <GothAlice> Use of an upsert is also strange. :/
[23:22:32] <qswz> like locale, name
[23:22:43] <qswz> if the user doesn't exist, it creates it
[23:23:03] <GothAlice> But, by definition, the user must already exist to even run that query. You're filtering on the ID of an existing user.
[23:23:18] <GothAlice> (Unless user._id can be NULL, in which case, wagh.)
[23:24:01] <qswz> yes that, ugly right
[23:24:22] <qswz> well it's wrong
[23:24:34] <qswz> user is null, ok did some shit
[23:25:27] <qswz> if I have {_id:1, x:1} and I want to update it with {x:2, y:3} but have {_id:1, x:1, y:3} at the end
[23:26:36] <qswz> well, it's ok, nvm
[23:26:53] <qswz> thanks for pointing me a mistae
[23:45:56] <atbe> Hi peeps, I have a question
[23:46:52] <atbe> I created a mongodb database and pointed it to a a $mydir/data/db directory but the size of that directory has not changed. Running `show dbs` shows that the database is at 75gb. Where is all that data?
[23:48:03] <atbe> Is there some command I need to execute so mongodb can save all that data into the directory? The memory usage is growing to be rather large
[23:48:44] <qswz> https://docs.mongodb.com/v3.2/core/document-validation/ What are all the $type 's available?
[23:49:50] <atbe> What do you mean by $type?
[23:49:52] <qswz> https://docs.mongodb.com/manual/reference/operator/query/type/#document-type-available-types
[23:51:04] <atbe> Ah, do we need all of them? Example:
[23:51:53] <atbe> object id, Null, String, int32, Object, Boolean, Int64
[23:52:48] <atbe> I don't understand how the validation relates to writing the data to the rom
[23:55:45] <atbe> https://usercontent.irccloud-cdn.com/file/GimMMcO5/Screenshot%20from%202016-11-08%2018-37-34.xcf
[23:56:02] <GothAlice> Document validation is like a find query.
[23:56:09] <atbe> woops wrong format
[23:57:05] <GothAlice> After any change to a document (e.g. inserting a new one, updating an existing one) if there's a validation document (and you didn't explicitly say "don't check" when inserting/updating) all MongoDB does is make sure the document being updated matches the query defined by the validation document.
[23:57:09] <GothAlice> No match, it's "invalid".
[23:57:18] <atbe> https://usercontent.irccloud-cdn.com/file/vFDau8Lc/Screenshot%20from%202016-11-08%2018-37-34.jpg
[23:57:30] <GothAlice> You can use everything you can use in a normal query in a validation document; this includes $and, $or, etc.
[23:58:11] <atbe> Okay, that will be useful when I decide to validate documents, but thankfully that is the not the issue I am having at the moment.
[23:58:25] <atbe> As you can see above the size is 75gb
[23:58:38] <GothAlice> Ah, yes, sorry, seems qswz's question and yours got blurred.
[23:59:21] <GothAlice> How did you "point" mongod? What was your command line + config (if used)?
[23:59:42] <atbe> mongod --dbpath ./data/db