diff --git a/manifest b/manifest index 96c29da340..48d287f576 100644 --- a/manifest +++ b/manifest @@ -1,8 +1,8 @@ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 -C Add\sWALTRACE()\smacros\sto\shelp\swith\sdebugging\sand\sanalysis. -D 2010-05-31T12:15:19 +C Do\snot\sfail\sa\scheckpoint\sjust\sbecause\sactive\sreaders\sprevent\sbackfill. +D 2010-05-31T12:30:52 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.in a5cad1f8f3e021356bfcc6c77dc16f6f1952bbc3 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -227,7 +227,7 @@ F src/vdbeblob.c 5327132a42a91e8b7acfb60b9d2c3b1c5c863e0e F src/vdbemem.c 2a82f455f6ca6f78b59fb312f96054c04ae0ead1 F src/vdbetrace.c 864cef96919323482ebd9986f2132435115e9cc2 F src/vtab.c a0f8a40274e4261696ef57aa806de2776ab72cda -F src/wal.c 880542c13b78c8c3480a1ca85c4893e01164392d +F src/wal.c 0b3cf78459540fc9504cc5c6670d656e95d6f48a F src/wal.h 1c1c9feb629b7f4afcbe0b47f80f47c5551d3a02 F src/walker.c 3112bb3afe1d85dc52317cb1d752055e9a781f8f F src/where.c 75fee9e255b62f773fcadd1d1f25b6f63ac7a356 @@ -764,7 +764,7 @@ F test/vtabE.test 7c4693638d7797ce2eda17af74292b97e705cc61 F test/vtab_alter.test 9e374885248f69e251bdaacf480b04a197f125e5 F test/vtab_err.test 0d4d8eb4def1d053ac7c5050df3024fd47a3fbd8 F test/vtab_shared.test 0eff9ce4f19facbe0a3e693f6c14b80711a4222d -F test/wal.test be8ef043253ca735ffcabb92a7dac2d79ebfe8c1 +F test/wal.test b965dc2509515a7758016cbec398ea4b1ff5424a F test/wal2.test c58bb5b2fac48b8393909038ced730df5ad973b0 F test/walbak.test e7650a26eb4b8abeca9b145b1af1e63026dde432 F test/walcksum.test 4efa8fb88c32bed8288ea4385a9cc113a5c8f0bf @@ -818,14 +818,14 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f -P 853f1e3f7720af2723b552bdf086bb106e6e93fe -R 120f65861720c5d4229e92e8bd223686 +P 765c33181a7b9d99b452ce750d69f217b3c81a5d +R 1e19bec8e3b7c1b6a9925e13022fc48f U drh -Z 5164efe54d9bd042fe1bad6aa9fe9dc9 +Z c22021b716c64e3ce3cd89536f71c5b9 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) -iD8DBQFMA6haoxKgR168RlERAtHPAJ413tpB3ORA2MgPN4oQbrLuYBHg0wCfaWeG -n630VhFDz8zIhJw1pFxWTdU= -=JKTG +iD8DBQFMA6wAoxKgR168RlERAqR7AJ9WJJ/VHv5q/R1C70ZExZQHh/d9XQCfVqlC +ZdxZW50cpNVzLpKcKSRyJHU= +=weXO -----END PGP SIGNATURE----- diff --git a/manifest.uuid b/manifest.uuid index a11ecdb001..1bd46b4f0d 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -765c33181a7b9d99b452ce750d69f217b3c81a5d \ No newline at end of file +9aa4243e0cedcc9204994d04af1b2b7a80c048bd \ No newline at end of file diff --git a/src/wal.c b/src/wal.c index 11ad7949ae..4287005886 100644 --- a/src/wal.c +++ b/src/wal.c @@ -1445,6 +1445,11 @@ static int walCheckpoint( /* Release the reader lock held while backfilling */ walUnlockExclusive(pWal, WAL_READ_LOCK(0), 1); + }else{ + /* Reset the return code so as not to report a checkpoint failure + ** just because active readers prevent any backfill. + */ + rc = SQLITE_OK; } walIteratorFree(pIter); diff --git a/test/wal.test b/test/wal.test index fbe0bd3ee7..27a9a7b17d 100644 --- a/test/wal.test +++ b/test/wal.test @@ -571,26 +571,17 @@ foreach code [list { } {1 2 3 4 5 6 7 8 9 10} do_test wal-10.$tn.12 { catchsql { PRAGMA wal_checkpoint } - } {1 {database is locked}} + } {0 {}} ;# Reader no longer block checkpoints do_test wal-10.$tn.13 { execsql { INSERT INTO t1 VALUES(11, 12) } sql2 {SELECT * FROM t1} } {1 2 3 4 5 6 7 8 9 10} - # Connection [db2] is holding a lock on a snapshot, preventing [db] from - # checkpointing the database. Add a busy-handler to [db]. If [db2] completes - # its transaction from within the busy-handler, [db] is able to complete - # the checkpoint operation. + # Writers do not block checkpoints any more either. # - proc busyhandler x { - if {$x==4} { sql2 COMMIT } - if {$x<5} { return 0 } - return 1 - } - db busy busyhandler do_test wal-10.$tn.14 { - execsql { PRAGMA wal_checkpoint } - } {} + catchsql { PRAGMA wal_checkpoint } + } {0 {}} # Similar to the test above. Except this time, a new read transaction is # started (db3) while the checkpointer is waiting for an old one (db2) to @@ -598,9 +589,8 @@ foreach code [list { # must wait until after db3 has closed the read transaction, as db3 is a # "region D" writer. # - db busy {} do_test wal-10.$tn.15 { - sql2 { BEGIN; SELECT * FROM t1; } + sql2 { COMMIT; BEGIN; SELECT * FROM t1; } } {1 2 3 4 5 6 7 8 9 10 11 12} do_test wal-10.$tn.16 { catchsql { PRAGMA wal_checkpoint }