> Pavel, please tell me you are wrong.  Surely windows maintains disk cache
> coherency even in the absence of explicit FlushFileBuffers() calls?

I'm sorry, I've got this idea from some post on this list. And only
after I wrote the email I've realized how scary it could be if it
worked this way.


Pavel


On Wed, Apr 13, 2011 at 10:25 AM, Richard Hipp <d...@sqlite.org> wrote:
> On Wed, Apr 13, 2011 at 9:53 AM, Pavel Ivanov <paiva...@gmail.com> wrote:
>
>> > The fact that one engineer installed a site, began operating the app,
>> > then saw it become corrupt minutes later rules out power loss or hard
>> > resets in at least that case. An operating system level problem should
>> > have been noticed by now given it's Windows XP... And the file is
>> > locally held too.
>>
>> I don't know how Windows's disk cache works but theoretically when you
>> set synchronous to OFF (0) OS can write database pages to disk in any
>> order it likes, disregarding the order SQLite requires. So while one
>> process writes those pages, another process can read those pages and
>> because of random writing order second process can read inconsistent
>> data, meaning it sees corrupted database.
>>
>
> Pavel, please tell me you are wrong.  Surely windows maintains disk cache
> coherency even in the absence of explicit FlushFileBuffers() calls?
>
> Can any windows experts comment on this?
>
>
>
>>
>>
>> Pavel
>>
>>
>> On Wed, Apr 13, 2011 at 7:14 AM, James Green <james.mk.gr...@gmail.com>
>> wrote:
>> > Yep we've read through that.
>> >
>> > Several of the possibilities are difficult to rule out of course. They
>> > just seem highly unlikely (!) given the rate of corruption across our
>> > sites.
>> >
>> > The fact that one engineer installed a site, began operating the app,
>> > then saw it become corrupt minutes later rules out power loss or hard
>> > resets in at least that case. An operating system level problem should
>> > have been noticed by now given it's Windows XP... And the file is
>> > locally held too.
>> >
>> > Is it possible that we're seeing something nasty occurring as a result
>> > of anti-virus software perhaps? I might expect a higher rate of
>> > corruption if so.
>> >
>> > The only avenue apparently open to us is to use WAL mode. Would WAL +
>> > sync=normal provide a much better resistance to corruption? We
>> > (probably) don't care about losing the last set of SQL statements.
>> >
>> > sync=full does not work well for our app (no transactions). Far too slow.
>> >
>> > James
>> >
>> > On 13 April 2011 11:47, Richard Hipp <d...@sqlite.org> wrote:
>> >> On Tue, Apr 12, 2011 at 5:15 AM, James Green <james.mk.gr...@gmail.com
>> >wrote:
>> >>
>> >>>  My question is does anyone have pointers
>> >>> to help us isolate the problems we are seeing.
>> >>>
>> >>
>> >> http://www.sqlite.org/howtocorrupt.html
>> >>
>> >> --
>> >> D. Richard Hipp
>> >> d...@sqlite.org
>> >> _______________________________________________
>> >> sqlite-users mailing list
>> >> sqlite-users@sqlite.org
>> >> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>> >>
>> > _______________________________________________
>> > sqlite-users mailing list
>> > sqlite-users@sqlite.org
>> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>> >
>> _______________________________________________
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>
>
>
>
> --
> D. Richard Hipp
> d...@sqlite.org
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to