Archived

This forum has been archived. Please start a new discussion on GitHub.

DB crashed after a large mount of db transaction

Hi :
In our program ,we do not register FatalErrorCallback using Freeze::registerFatalErrorCallback.
After a large amount of db transactions I found that Berkerley DB throw a DBException (caught at EvictorI.cpp line 1683) and this exception is convert to DatabaseException and threw out again .the new exception is caught at EvictorI.cpp line 1742 .finally program exit because Freeze call abort in function handleFatalError(...) . and the member env_ in DBException is NULL when the error threw out.
I delete the DB file when the problem occurred ,but DB will crash again in our pressure test(this will cause a large mount of DB transaction)
I don't know if I misuse the Freeze or not ?
Could any one give me a hand if you can ?
Thank you very much !

BTW:
Ice Version :3.1.0
Build Env: VC6 + SP5
Test Env: WIN 2003 +SP2

Comments

  • matthew
    matthew NL, Canada
    I'm sorry but we don't provide free support for old versions of Ice. Please first upgrade to Ice 3.2.1 and then re-run your test. It would also be helpful for you to tell us what error specifically you are getting when your application halts.
  • Hi matthew:
    Thank you for reply.
    I'll update ice later.
    For now,the only information I can get from the DBException instance is the exception description as below.I don't know why the env_ is NULL in the exception instance .

    DbTxn::abort: DB_RUNRECOVERY: Fatal error, run database recovery


    Additional , after this exception,the program will exit and our monitor will re-run the program when it found the program exit. But the new program instance don't complain the DB problem when program startup again



    Thank you again.
  • Hi :
    I have upgraded ice to 3.2.1 and re-build my program .
    after a mount of pressure test,I found that some exception is threw out from the code block below:(these code lie in Freeze::EvictorI::run() function)
    try
    {
    for(size_t i = 0; i < txSize; i++)
    {
    StreamedObject& obj = streamedObjectQueue;
    obj.store->save(obj.key, obj.value, obj.status, tx);
    }
    }
    catch(...)
    {
    //some exception is cathed here and then call tx->abort ()
    tx->abort();
    if(_txTrace >= 1)
    {
    Trace out(_communicator->getLogger(), "Freeze.Evictor");
    out << "rolled back transaction " << hex << txnId << dec;
    }
    throw;
    }

    Then I study BerkeleyDB's source and found BerkeleyDB only throw exception which is derived from DbException or DbException its self.
    So I and a catch block to the code ,and now it became like below:
    try
    {
    for(size_t i = 0; i < txSize; i++)
    {
    StreamedObject& obj = streamedObjectQueue;
    obj.store->save(obj.key, obj.value, obj.status, tx);
    }
    }
    catch (const DbDeadlockException&)
    {//if the exception is DbDeadlockException ,just let it go
    //So I don't set breakpoint here

    tx->abort();
    if(_txTrace >= 1)
    {
    Trace out(_communicator->getLogger(), "Freeze.Evictor");
    out << "rolled back transaction " << hex << txnId << dec;
    }
    throw;
    }
    catch (const DbException&)
    {//I set a break point here to see if DbException is threwout
    tx->abort();
    if(_txTrace >= 1)
    {
    Trace out(_communicator->getLogger(), "Freeze.Evictor");
    out << "rolled back transaction " << hex << txnId << dec;
    }
    throw;
    }
    catch(...)
    {//set a break point here
    tx->abort();
    if(_txTrace >= 1)
    {
    Trace out(_communicator->getLogger(), "Freeze.Evictor");
    out << "rolled back transaction " << hex << txnId << dec;
    }
    throw;
    }

    But to my surprise ,there is no break at catch (const DbException&) block but
    catch(...).

    So I think this is a system exception,but I can't get the exception code using __try and __except statement here .

    Is there anybody enoucnter this problem before ?
    Actually I have no idea on this .

    BTW:
    I also set break at ObjectStore.cpp line 231 and line 243 to see if ice throw an exception when db operation is failed,but program has broken at these two lines
  • matthew
    matthew NL, Canada
    It sounds like a structured exception is being thrown (like access violation). If you run the application in a debugger you can tell it to break on exceptions and that would give you a better hint as to what is occurring.

    If you would like us to look into this issue further you should send a complete, self-contained, compilable test case.