Re: [sqlite] WAL2 mode

2019-11-12 Thread Dan Kennedy


On 12/11/62 19:00, Simon Slavin wrote:

On 12 Nov 2019, at 10:06am, Dan Kennedy  wrote:


This branch might interest you:

   https://www.sqlite.org/src/timeline?r=begin-concurrent-pnu-wal2

" In wal2 mode, the system uses two wal files instead of one. The files are named "-wal" 
and "-wal2""

Could this be changed to -wal1 and -wal2 ?  Or any other suffixes that aren't 
used by a different mode ?

This is to make crash/corruption diagnostics simpler.  At the moment, if the 
database file is so corrupt it can't be opened by SQLite, just by looking at 
the files in the directory I can tell a lot about what journal mode the 
database was in and what was being done, and what the user did to try to 
restore a backup.

But users do all sorts of weird things to try to recover from crashes, 
including restoring a database, sometimes in a different journal mode, but 
leaving journal files in place.  Seeing whether there's a -wal file and/or a 
-wal1 file, and comparing the changedates on the files, will give me better 
clues about what was done.  It means I can get further in figuring out what was 
going on before hexdumping the files concerned.


Fair point.

I think it reuse *-wal in order to avoid an extra call to access() when 
opening a read-transaction in rollback mode. There might be other 
reasons too. It's only a branch for now - this is something to consider 
if it ever gets rolled into the main version though.


Dan.



___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] WAL2 mode

2019-11-12 Thread Simon Slavin
On 12 Nov 2019, at 10:06am, Dan Kennedy  wrote:

> This branch might interest you:
> 
>   https://www.sqlite.org/src/timeline?r=begin-concurrent-pnu-wal2

" In wal2 mode, the system uses two wal files instead of one. The files are 
named "-wal" and "-wal2" "

Could this be changed to -wal1 and -wal2 ?  Or any other suffixes that aren't 
used by a different mode ?

This is to make crash/corruption diagnostics simpler.  At the moment, if the 
database file is so corrupt it can't be opened by SQLite, just by looking at 
the files in the directory I can tell a lot about what journal mode the 
database was in and what was being done, and what the user did to try to 
restore a backup.

But users do all sorts of weird things to try to recover from crashes, 
including restoring a database, sometimes in a different journal mode, but 
leaving journal files in place.  Seeing whether there's a -wal file and/or a 
-wal1 file, and comparing the changedates on the files, will give me better 
clues about what was done.  It means I can get further in figuring out what was 
going on before hexdumping the files concerned.
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users