PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Tuesday the 15th of September, 2015

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[01:11:06] <silasbarta> so is the mongo v3 logger supposed to write the full document that gets created?
[01:11:11] <silasbarta> oops sorry
[02:06:28] <tejasmanohar> hey guys im modeling out a referrals system where i also want to be able to rank users based on their referrals
[02:06:29] <tejasmanohar> https://gist.github.com/tejasmanohar/709a89afd23e804ed194
[02:06:54] <tejasmanohar> should i be using a counter cache for this? i feel like the other method would be quite inefficient.
[02:06:58] <tejasmanohar> but i also hate data duplication
[02:07:22] <tejasmanohar> should i just cache my queries? O.o
[03:10:31] <JaVaSan> Hi, is there any way to create a query to retrieve a nested array as the root document in response? (i.e. I would like instead of {"fieldArray" : [...] } something like {[...]} here fieldArray is the nested field which is an array of documents)
[03:13:21] <joannac> you know that {[...]} is not a valid document, right?
[03:16:40] <JaVaSan> @joannac, sorry, I mean something like [{...}, {...}]
[03:18:19] <JaVaSan> so, instead of {"fieldArray" : [{...}, {...}] } I would like to retrieve [{...}, {...}].
[09:26:08] <carver404> hi, i'm getting a 404 while installing mongodb 3.0.x on fedora.. any headers?
[09:26:38] <carver404> the baseurl https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.0/x86_64/ gives 404
[11:16:10] <Siyfion> I keep getting a "MongoError: cursor killed or timed out" when performing a simple .find({}) on a collection with around 10MB of data in it... Any idea why that might be?
[11:16:21] <Siyfion> Or even how I can diagnose the issue?
[11:19:00] <Siyfion> Looks like this issue: https://jira.mongodb.org/browse/NODE-300
[11:19:08] <Siyfion> But it's supposed to be fixed :/
[11:29:51] <tibyke> moin
[11:31:49] <tibyke> im trying to find in a db and order the results by the multiplication (or whatever mathematical relation) of two fields. should it be whatever.find(..., ...).aggregate() or whatever.aggregate().find(..., ...)? neither of these works actually :)
[11:43:04] <carver404> Siyfion: http://docs.mongodb.org/v3.0/reference/method/cursor.addOption/#DBQuery.Option.noTimeout
[11:43:12] <carver404> add a no timeout option
[11:43:27] <Siyfion> carver404: Tried that and it still bombed.
[11:43:44] <Siyfion> I think it's that I'm doing too much stuff concurrently with the same db client
[11:43:56] <Siyfion> Just split it into two processes, and it's happy
[11:44:00] <carver404> happened with me a while ago and that solved the prb though
[11:44:02] <Siyfion> run one after the other
[11:44:28] <carver404> :D worked that way?
[11:51:26] <Siyfion> yup, really weird
[11:51:37] <Siyfion> but it worked, and as it was a migration script. Done!
[11:51:39] <Siyfion> :D
[15:25:13] <jarthur> Anyone have experience with PyMongo in a multithreaded environment?
[15:36:58] <Owner> Hi
[15:37:21] <Owner> quick security question about oplog
[15:37:52] <Owner> can / does oplog potentially leak data between logical databases if a spy had access to the 'oplog' data
[15:39:30] <cheeser> "between logical databases?"
[15:39:53] <cheeser> but yes, the oplog might have sensitive information in it so you should restrict roles accordingly.
[15:39:57] <Owner> well leak data out of all the databases
[15:40:13] <Owner> ok, but you can only have one oplog for the entire cluster
[15:40:19] <cheeser> yes
[15:40:26] <cheeser> but not everyone needs to be able to read it
[15:40:32] <Owner> so any 'application' that uses the oplog, the owner of that application could potentially see other applications data
[15:40:47] <cheeser> yes. so don't do that.
[15:40:47] <Owner> well in this case, all copies of the application need oplog
[15:45:30] <zacharypch> HI - is there a configuration option in mongo3 for hyphenation as a delimiter in text indexes? I want to keep english as the language choice, just remove the treatment of hyphenation as splitting since my dataset has a lot of hyphenated terms
[15:45:31] <zacharypch> also numbers next to letters, like abc123 should be one word
[15:46:21] <cheeser> zacharypch: no
[15:47:52] <cheeser> /4
[15:48:29] <zacharypch> cheeser: how are the languages defined? can I invent my own language?
[15:49:46] <Owner> cheeser, well for performance reasons this app needs the oplog, but for economic reasons, they only want one mongo cluster for all the environments to share (with seperate dbs)
[15:50:22] <Owner> but cross zone data leakage is bad for security
[15:55:17] <cheeser> zacharypch: you can't as far as i know.
[15:55:43] <cheeser> Owner: if you don't expose the oplog directly to users, you can filter by db
[16:14:29] <deathanchor> what's the right way to have two member replset with no 3rd member for the short term?
[16:14:45] <cheeser> use an arbiter
[16:22:33] <deathanchor> I'm going to use a 3rd member secondary, but I have to build it
[16:22:39] <deathanchor> will take me about a day
[16:22:58] <deathanchor> was thinking of giving primary votes : 2 just to break ties for now
[16:24:29] <mensgis> hey all! I'm switching from a application that created id's like kScTJM9n+g2TUU9eVfQu .. To do things right, right from the beginning, I'd like to use valid ObjectId's. Do you have any idea on how to change existing data easily?
[16:24:58] <StephenLynx> just remove those ids.
[16:25:07] <StephenLynx> every object will already have its own unique _id
[16:25:12] <StephenLynx> document*
[16:26:06] <mensgis> i am speaking about the _id-attribute.. will removing it just create a new one? if so I might go for updating references manually
[16:27:50] <mak``> Hello :) If I don't care about sequentiality of numeric IDs, but I want uniqueness and for the service to not be a SPOF, how can I do this? I need numeric 32bit integer IDs for MongoDB and sync it with SQL Server in a distributed system.
[16:28:26] <StephenLynx> wait, wait
[16:28:32] <StephenLynx> what data do you have right now?
[16:28:38] <StephenLynx> and where is it stored?
[16:29:08] <StephenLynx> mak`` the default _id is already unique within a collection
[16:30:23] <mak``> StephenLynx: I need 32bit ints, not guids :(
[16:30:35] <deathanchor> RDBs syncing with NoSQLDBs (or vice versa) is like trying making special sauce: goes bad if left in the sun too long.
[16:30:40] <mak``> I need to deprecate a SQL server with identity column 32bit ints
[16:30:54] <mak``> deathanchor: fully agree
[16:31:13] <StephenLynx> they are not GUIDS
[16:31:15] <StephenLynx> afaik
[16:32:15] <StephenLynx> http://stackoverflow.com/a/16163174/925424
[16:32:32] <mak``> ObjectId is too big for me
[16:32:51] <StephenLynx> for you?
[16:32:59] <StephenLynx> what does that mean?
[16:33:45] <mak``> I need to store this ID in a legacy platform that was using 32bit ints
[16:34:35] <deathanchor> mak``: use the value of it?
[16:34:40] <deathanchor> oh wait
[16:34:45] <deathanchor> not going to be 32 bits
[16:35:18] <StephenLynx> why don't you do the oposite?
[16:35:19] <mak``> deathanchor: ObjectID is 12 bytes
[16:35:32] <StephenLynx> and store on mongo the id that you have on the legacy system?
[16:36:22] <mak``> StephenLynx: the current system generates the ID in SQL Server and persists it in MongoDB, but it is a nightmare of message queue and we need to change the master from the legacy system to the new system and ultimately switch off SQL Server
[16:36:35] <StephenLynx> so?
[16:36:39] <mak``> a big set of legacy apps expects the user id to be 32bit ints sadly
[16:36:59] <mak``> otherwise I would use mongodb Object ID or UUIDs
[16:37:23] <StephenLynx> you are going to have to store a cross-database foreign key anyway
[16:37:31] <StephenLynx> might as well do it the most natural way
[16:37:44] <StephenLynx> generate on the less capable end and store on the most capable end.
[16:40:04] <mak``> the thing is that I need to switch off the less capable end :(
[16:44:00] <StephenLynx> I can't see whats the issue there
[16:44:13] <StephenLynx> once you do that, start using the values from the most capable end.
[16:59:45] <mak``> The legacy apps consuming the IDs cannot parse anything not 32 bit ints
[16:59:54] <mak``> because they have been implemented in a stupid way
[17:00:01] <mak``> they use that as a number instead of a string
[17:01:43] <StephenLynx> hm
[17:01:51] <StephenLynx> ok, what about this:
[17:02:15] <StephenLynx> generate sequential 32 bits ids in your application
[17:02:30] <StephenLynx> and set a unique index on the collections for this field.
[17:02:54] <StephenLynx> this way you are guaranteed to never have a duplicate.
[17:05:16] <cheeser> or use findAndModify() to let the db track those for you.
[17:05:54] <cheeser> it'd mean an extra db trip but it'd be durable across application runs and unique across a cluster (provided you have more than one instance of the app running)
[17:06:28] <yopp> hum
[17:07:08] <yopp> is there anything like pay per incident support ?
[17:07:26] <cheeser> nope
[17:13:59] <yopp> :|
[17:21:02] <mak``> thanks StephenLynx and cheeser I am going to think about it tomorrow as I am not functioning anymore today :D
[18:37:01] <ChALkeR> Hi all.
[18:37:08] <ChALkeR> I know I'm a bit late.
[18:37:53] <ChALkeR> But could someone point me to some info on what was going on with all the js engine switches back and forth?
[18:38:13] <StephenLynx> hm?
[18:38:31] <StephenLynx> I just know WT is going to be the default soon
[18:38:48] <ChALkeR> I'm talking about js engines.
[18:39:06] <ChALkeR> From spidermonkey to v8
[18:39:17] <ChALkeR> then to spidermonkey again
[18:39:27] <ChALkeR> then removing v8 support
[18:39:49] <StephenLynx> hm, I don't even know what it uses to parse js, tbh.
[18:40:04] <StephenLynx> does it parses js server side?
[18:40:15] <ChALkeR> https://jira.mongodb.org/browse/SERVER-19376
[18:40:24] <ChALkeR> https://jira.mongodb.org/browse/SERVER-19378
[18:40:56] <StephenLynx> hm
[18:50:10] <ChALkeR> Before that: https://jira.mongodb.org/browse/SERVER-2407
[18:52:06] <StephenLynx> well, the time they rolled with v8 was a long time ago.
[18:52:18] <StephenLynx> maybe something drastic changed with v8 and spidermonkey
[18:52:43] <StephenLynx> 4 year gap, it seems
[19:34:33] <silasbarta> So is there any reason why mongo v3 writes entire insert commands to the logs, showing the entire document?
[19:35:44] <silasbarta> And does anyone see my comments?
[19:38:17] <silasx> Sorry if I’m repeating myself, but is there any reason why the mongo logs would display an entire document that got inserted?
[19:38:46] <deathanchor> silasx: slow operation, anything longer than 100ms
[19:38:53] <deathanchor> that's the default
[19:39:11] <silasx> ahhh … thannks deathanchor. Is that documented anywhere? And what’s the setting that governs that?
[19:39:21] <deathanchor> profiler
[19:39:38] <cheeser> http://docs.mongodb.org/manual/reference/method/db.setProfilingLevel/
[19:39:59] <deathanchor> http://docs.mongodb.org/manual/reference/configuration-options/#operationProfiling.slowOpThresholdMs
[19:40:28] <deathanchor> use cheeser's link to change it while mongod is running
[19:40:38] <deathanchor> and my link to set it for every mongod startup
[19:41:22] <deathanchor> I noticed that large document inserts usually show up in the logs.
[19:43:10] <silasx> Thanks a ton guys! My setting is currently {was: 0, slowms: 100} … so that means the profiling level is 0, but it will still log 100ms ops?
[19:44:09] <silasx> And there’s no separate profiling log from the system log?
[19:45:32] <deathanchor> silasx: 0 only writes to logs, 1 writes slow ops to profile collection (capped collection), 2 writes all ops of that db
[19:46:20] <deathanchor> http://docs.mongodb.org/manual/reference/command/profile/#dbcmd.profile
[19:46:23] <deathanchor> read more docs
[19:47:25] <deathanchor> just how big are these inserts and how long are they taking?
[19:53:18] <StephenLynx> hey, findOne can perform faster because it will stop when finds a document, right?
[19:53:32] <StephenLynx> while a count might take more because it will run the whole collection?
[19:53:43] <StephenLynx> I just want to check if a single document exists with a given query
[19:54:10] <deathanchor> findOne faster
[19:54:24] <deathanchor> basically it's a find().limit(1).pretty()
[19:54:32] <silasx> @deathanchor: Ah, okay, the 100ms threshold holds all the time. Yeah some of these may be because of taking a long time, some are big inserts, but still that seems like a long time. Will have to look into it but this explains a lot.
[19:55:18] <StephenLynx> in the meanwhile, if I want to check if TWO documents exist, a count will be faster than a find and toArray because it will perform less work at each document found?
[19:55:19] <deathanchor> silasx: I was curious how big these docs were and how slow they were. I deal wiht some big docs also
[19:56:00] <deathanchor> StephenLynx: nah, I would a find().limit(2)
[19:56:18] <deathanchor> StephenLynx: count would scrub through your whole damn collection again
[19:57:09] <StephenLynx> ah
[19:57:10] <StephenLynx> indeed.
[19:57:16] <StephenLynx> limit
[19:58:27] <silasx> let me take a look at some of these
[20:09:10] <deathanchor> limit... for when you just don't care about the rest.
[20:09:21] <silasx> @deathanchor if your’e still around, a bunch of these are insertions of docs around 3000 bytes in length … doesn’t seem like they’d take a long time
[20:10:39] <deathanchor> the w: and r: values on the long line are micros waiting for a w/r lock.
[20:11:02] <deathanchor> microseconds.
[20:12:29] <silasx> ah, didn’t notice this thing at the end of the line
[20:12:50] <silasx> @deathanchor: most of those are 1-2, but there’s also this: timeAcquiringMicros: { w: 1331327 } }
[20:12:53] <deathanchor> all kinds of goddies
[20:13:02] <silasx> and the line in question is 831ms
[20:13:56] <deathanchor> yeah I still don't understand how if the write lock wait was 1.3 seconds how the op time is less than that (0.8 seconds)
[20:14:22] <deathanchor> I wrote up a vim syntax highlighter for mongologs
[20:14:34] <deathanchor> still needs polish
[20:14:35] <silasx> so … next steps to diagnose something like that?
[20:14:48] <silasx> oooh, give give! I love my vim :-]
[20:14:51] <deathanchor> silasx: what problem are you trying to solve?
[20:15:36] <silasx> @deathanchor well, a few: 1) We don’t like data being written to logs for security reasons, and 2) now that we see these are long ops, why are they taking so long
[20:16:47] <deathanchor> silasx: let me publish my vim file on github
[20:18:19] <deathanchor> well slowms you can set to some large number
[20:18:33] <deathanchor> write locks, sounds like contention to me.
[20:19:50] <silasx> wait what about slow ms? What would I set to a large number? Looking up contention
[20:21:27] <beekin> When using the aggregation pipeline, I read somewhere that's it best practice to $match and $project early on in order to trim data. Does this mean, that I should always be projecting only what's needed for the entire aggregation?
[20:21:42] <beekin> *that it's
[20:24:29] <deathanchor> beekin: yes
[20:24:38] <beekin> That's nifty.
[20:25:26] <silasx> Reconnected, making sure I can still post
[20:25:52] <deathanchor> beekin: I have hit this error: 16MB doc size limit for results, limit it to a smaller number
[20:26:08] <deathanchor> or even worse: exception: terminating request: request heap use exceeded 10% of physical RAM
[20:26:29] <deathanchor> $limit to the rescue
[20:27:06] <deathanchor> love when my aggregation exceeds 2gb.
[20:28:32] <beekin> Ah, yeah, I forgot about the 16mb limit.
[20:30:24] <Owner> how do i upgrade mongodb from 2.0.4 to 3.0.6?
[20:31:05] <silasx> brb thanks again for the help @deathanchor
[20:43:58] <deathanchor> vim highlighting of mongologs: https://github.com/deathanchor/vim-addtions
[21:15:18] <diegoaguilar> Hello, is there a way to drop a database and not to lose the created indexes
[21:15:42] <diegoaguilar> I mean, whenever I create/add data again, I want such indexes to persist
[21:16:26] <Owner> jeez im trying to run mongodb as the mongodb user from root, but its not doing anything or logging anything :(
[21:17:15] <cheeser> i'm sure there's a question in there somewhere. some details of what you tried would be helpful.
[21:17:37] <cheeser> diegoaguilar: just db.collection.remove({})
[21:17:45] <Owner> like su -c
[21:22:52] <Owner> this page is missing that information
[21:22:52] <Owner> http://docs.mongodb.org/master/tutorial/install-mongodb-on-linux/
[21:28:59] <diegoaguilar> Ok, get that cheeser
[21:29:00] <diegoaguilar> thanks
[21:29:55] <Owner> hmm got it...sudo didnt like quots around the command, works without them
[21:34:10] <Owner> can i do a mongodump of a 2.0 database and import into a 3.0 ?
[23:36:42] <_syn> anybody use apache Storm and Redshift with Mongo ?