Reputation: 31
I'm running mongodb server 2.4.5 on Ubuntu 12.04.1. My application writes to the DB via Morphia Layer (0.104) and mongo-java-driver (2.12-rc2). Things work nice. However in the /var/log/mongodb/mongodb.log there are entries like:
Fri Mar 28 07:45:12.614 [conn3621] update messdatenDB.meterdata query: { _id: "53351a789932d0c43be306c3" } update: { _id: "53351a789932d0c43be306c3", datum: 1395989112296, name: "010034070000", deviceType: "SGH", deviceID: "DC006487", mandantID: "520dee1299322f8346c57fd6", value: 0.7000000000000001, unit: "V", version: 1 } idhack:1 nupdated:1 upsert:1 keyUpdates:0 locks(micros) w:39 318ms F
I get these entries just for this db/collection. Sometimes every few minutes, sometimes there is a gap for some hours.
The collection 'messdatenDB.meterdata' is regularly written to with new data objects - there is never an update like the logfile says. Does that mean, that double id's are created? Can anyone give me a hint, what the logfile entry might tell? Thanks for any suggestion!
Upvotes: 1
Views: 56
Reputation: 2821
MongoDB will write an entry to the log file when an operation takes longer than your slowMS threshold - which defaults to 100ms. In this case your operation took 318ms. So the reason you see this is really just due to to length of time it took for this update to complete. You can tune this threshold and optionally log slow operations to a profiling collection via the database profiler.
As for _id it is strange that that it is being included as part of the update clause. _id by definition is immutable and cannot be changed. In this case the update is trying to set the _id to its existing value and results in a no-op. If the update tried to change the value of _id it would fail.
Upvotes: 1