data loss vs flush (was: TIP, how to fight with corrupted indexing)

Robert Brenstein rjb at rz.uni-potsdam.de
Tue Feb 4 17:56:31 CST 2003


>on 2/4/03 2:15 PM, Robert Brenstein at rjb at rz.uni-potsdam.de wrote:
>
>>>>
>>>>   Ruslan, I Flush after each database change but I definitely had data
>>>>   loss on a few ocassions (yes, data was entered into db but was not
>>>>   there after crash). I recon that Flush cleans the caches of Valentina
>>>>   but the operating system has its own write cache that may prevent the
>>>>   data to be actually written to disk before the crash.
>>>
>>>  No, Flush() at first write from Valentina cache,
>>>  Then calls system flush() to force data be written on disk.
>>>
>>
>>  Hmm, if so, then how is it possible that I lost data? I do not
>>  imagine that. My program writes a log of all transactions, so I could
>>  verify that user indeed did data entry and it was processed properly
>>  but the data was NOT in the database after the server restart. Last
>>  several transactions before each crash seem to be always lost.
>
>Really strange.
>
>1) you use MacOS 9, yes?

yes

>2) may be not all modifications are followed by Flush?

no, not every single one

>3) Try add AFTER Flush() call also log into YOUR file, that Flush() was
>done. This can help to see that crash was not inside of Flush()

Testing this is actually not so trivial since I can't cause crashes 
on my main server just for the heck of testing. I worked hard to get 
rid of them (seemingly successfully so far).

None of my tests in "lab" conditions, if you recall from last fall, 
were successful in recreating those crashes elsewhere.

But I am just starting major rewrite of this program, and I will put 
debugging code to trace those situations easier.

Robert


More information about the Valentina mailing list