This project has moved. For the latest updates, please go here.

PersistentDictionary - EsentCommittedLogFileCorruptException.

Nov 5, 2012 at 9:09 PM

Hello,

I am seeing the exception below when I try to instantiate a PersistentDictionary after having updated a few dictionary entries in a previous test.

Is 'EsentCommittedLogFileCorruptException' recoverable ?

If so, how ?

I am running tests where I power hit my windows 7 box while it is updating the dictionary and then try to read the database upon reboot.

Thanks,

-Randy

 

The ex ception:

Unhandled Exception: Microsoft.Isam.Esent.Interop.EsentCommittedLogFileCorruptEx
ception: One or more logs were found to be corrupt during recovery.  These log f
iles are required to maintain durable ACID semantics, but not required to mainta
in consistency if the JET_bitIgnoreLostLogs bit and JET_paramDeleteOutOfRangeLog
s is specified during recovery.
   at Microsoft.Isam.Esent.Interop.Api.Check(Int32 err)
   at Microsoft.Isam.Esent.Interop.Api.JetInit2(JET_INSTANCE& instance, InitGrbi
t grbit)
   at Microsoft.Isam.Esent.Interop.Instance.Init(InitGrbit grbit)
   at Microsoft.Isam.Esent.Collections.Generic.PersistentDictionary`2..ctor(Stri
ng directory)
   at ManagedEsentTest.Program.Main(String[] args) in D:\TestApps\DatabaseTests\
InsertIntoDB\InsertIntoDB\ManagedEsentTest\Program.cs:line 129

Developer
Nov 5, 2012 at 10:57 PM

Losing power during write operations is always a scary proposition, especially with consumer-level hardware. Consumer hard drives are a cutthroat industry with extreme price-sensitivity.

You can try specifying Windows7Grbits.ReplayIgnoreLostLogs to the JetInit function. I'll warn you that the situtation does not look good.

-martin

Developer
Nov 5, 2012 at 11:01 PM

By the way, there is some additional robustness if you enable:

        /// <summary>
        /// This parameter sets the number of logs that esent will defer database
        /// flushes for. This can be used to increase database recoverability if
        /// failures cause logfiles to be lost.
        /// </summary>
        public const JET_param WaypointLatency = (JET_param)153;

But it has the downside that if you crash after a Commit, but before the data gets written to the log file, the transaction will be committed if you crash/reboot. Many people do not care about this, but it is the 'D' in 'ACID' ('Durable') which database engines try to adhere to.

-martin

 

 

 

Nov 5, 2012 at 11:39 PM

Ok, thanks Martin.

Yes, power cycling a machine while the disk is being written to is definitely a nasty thing to do.

Dumb question, but how do I set Windows7Grbits.ReplayIgnoreLostLogs such that it affects PersistenDictionary ?

-Randy