Assertion failure in mongodb 1.6.x

16 views
Skip to first unread message

Frank Sorro

unread,
Sep 6, 2010, 5:29:40 AM9/6/10
to mongodb-user
Hi,
I'm having a problem with my map/reduce function which only occurred
after upgrading to mongodb 1.6.1. I am currently using pymongo 1.5 and
mongodb 1.6.2.

My map/reduce functions look like this: http://pastebin.com/RZBau2Vs

And the log shows messages like these:

Mon Sep 6 10:25:20 [conn39] CMD: drop
smms_db.tmp.mr.mapreduce_1283761520_8
Mon Sep 6 10:25:20 [conn39] CMD: drop
smms_db.tmp.mr.mapreduce_1283761520_8_inc
Mon Sep 6 10:25:20 [conn39] building new index on { 0: 1 } for
smms_db.tmp.mr.mapreduce_1283761520_8_inc
Mon Sep 6 10:25:20 [conn39] Buildindex
smms_db.tmp.mr.mapreduce_1283761520_8_inc idxNo:0 { ns:
"smms_db.tmp.mr.mapreduce_1283761520_8_inc", key: { 0: 1 }, name:
"0_1" }
Mon Sep 6 10:25:20 [conn39] getFile(): n=-2
Mon Sep 6 10:25:20 [conn39] Assertion: 10295:getFile(): bad file
number value (corrupt db?): run repair
Mon Sep 6 10:25:20 [conn39] Caught Assertion in insert , continuing
Mon Sep 6 10:25:20 [conn39] insert smms_db.system.indexes exception
10295 getFile(): bad file number value (corrupt db?): run repair 5ms
Mon Sep 6 10:25:20 [conn39] building new index on { _id: 1 } for
smms_db.tmp.mr.mapreduce_1283761520_8
Mon Sep 6 10:25:20 [conn39] Buildindex
smms_db.tmp.mr.mapreduce_1283761520_8 idxNo:0 { name: "_id_", ns:
"smms_db.tmp.mr.mapreduce_1283761520_8", key: { _id: 1 } }
Mon Sep 6 10:25:20 [conn39] getFile(): n=-2
Mon Sep 6 10:25:20 [conn39] Assertion: 10295:getFile(): bad file
number value (corrupt db?): run repair
Mon Sep 6 10:25:20 [conn39] mr failed, removing collection
Mon Sep 6 10:25:20 [conn39] CMD: drop
smms_db.tmp.mr.mapreduce_1283761520_8
Mon Sep 6 10:25:20 [conn39] smms_db Assertion failure a.ext()-
>xprev.isNull() db/pdfile.cpp 705
Mon Sep 6 10:25:20 [conn39] CMD: drop
smms_db.tmp.mr.mapreduce_1283761520_8_inc
Mon Sep 6 10:25:20 [conn39] smms_db Assertion failure a.ext()-
>xprev.isNull() db/pdfile.cpp 705

Weird thing is, I just dumped and restored the whole db content last
week and also started a repairDatabase() and there was no crash oder
similar since then. My understanding from the log messages is that the
map/reduce execution inside the server runs some insert which fails
but I can't exactly tell why (and from my feeling this can only be a
bug since inserts constructed by mongodb shouldn't fail, is that
right?).

Can someone please help me on this?

Greets, Frank

Eliot Horowitz

unread,
Sep 6, 2010, 8:53:16 AM9/6/10
to mongod...@googlegroups.com
After upgrading to 1.6.2 did you run the repair? Has it happened on 1.6.2?

> --
> You received this message because you are subscribed to the Google Groups "mongodb-user" group.
> To post to this group, send email to mongod...@googlegroups.com.
> To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
>

Frank Sorro

unread,
Sep 6, 2010, 9:13:59 AM9/6/10
to mongodb-user
What happened, in this order:
- problem appeared with 1.6.1, a day after a repair
- updated to 1.6.2
- problem persisted
- ran repairDatabase()
- now it works again

So, answering your questions: I did run repair after upgrading to
1.6.2, but even before repair this problem has happened using 1.6.2.

Do I understand your question correctly: was it necessary to run
repair after upgrade from 1.6.1 to 1.6.2? I had thought that the
statement "pdfile version 4.5" in the log means that the db file
format hasn't changed since 1.4.x (at least).

It works fine for me at the moment, but I don't really feel safe with
this because this problem seems to have appeared without any upgrade
or similar and with my program unchanged.

On 6 Sep., 14:53, Eliot Horowitz <eliothorow...@gmail.com> wrote:
> After upgrading to 1.6.2 did you run the repair?  Has it happened on 1.6.2?
>

Eliot Horowitz

unread,
Sep 6, 2010, 11:42:26 AM9/6/10
to mongod...@googlegroups.com
That assertion was most likely caused by a bug present in 1.6.0 and 1.6.1
That requires a repair.
So upgrading to 1.6.2 fixed the code problem, but you needed to do a repair to fix the data problem.

Josef

unread,
Sep 16, 2010, 12:33:58 PM9/16/10
to mongodb-user
Hi,

we do encounter a similar issue. After upgrading from 1.2.1 to 1.6.2
we got errors during db inserts. Log says
"Assertion: 10295:getFile(): bad file number value (corrupt db?): run
repair".

During running repairDatabase() the same assertion shows up in the log
file multiple times. Is this anything I need to worry about?

Besides, how do I figure out if repairDatabase() has finished?

(We are using mongodb 1.6.2 on linux x64 and java driver 2.0; setup as
replica pair, switch to replica set is planned.)

Thanks,
Josef
> > mongodb-user...@googlegroups.com<mongodb-user%2Bunsubscribe@google groups.com>
> > .
> > > > For more options, visit this group athttp://
> > groups.google.com/group/mongodb-user?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "mongodb-user" group.
> > To post to this group, send email to mongod...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > mongodb-user...@googlegroups.com<mongodb-user%2Bunsubscribe@google groups.com>
> > .

Eliot Horowitz

unread,
Sep 16, 2010, 2:08:48 PM9/16/10
to mongod...@googlegroups.com
You should see a message in the log when a repairDatabase has finished.

> To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages