]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Before beginning an incremental checkpoint in RBU, sync the directory
authordan <dan@noemail.net>
Fri, 3 Mar 2017 16:51:46 +0000 (16:51 +0000)
committerdan <dan@noemail.net>
Fri, 3 Mar 2017 16:51:46 +0000 (16:51 +0000)
containing the target database file. This ensures that the new directory entry
created by renaming the *-oal file to *-wal is synced to disk.

FossilOrigin-Name: 915a9a28783fbb2f4c0794eb4264ce8c0b9d42f7

ext/rbu/sqlite3rbu.c
manifest
manifest.uuid

index 163a5442599da51ee5ca8775546b8db2c6071e7e..7dd232b4b56c5aa52b82cd39d8c580fa444ce085 100644 (file)
@@ -2624,6 +2624,7 @@ static void rbuSetupCheckpoint(sqlite3rbu *p, RbuState *pState){
     }else{
       int nSectorSize;
       sqlite3_file *pDb = p->pTargetFd->pReal;
+      sqlite3_file *pWal = p->pTargetFd->pWalFd->pReal;
       assert( p->nPagePerSector==0 );
       nSectorSize = pDb->pMethods->xSectorSize(pDb);
       if( nSectorSize>p->pgsz ){
@@ -2631,6 +2632,12 @@ static void rbuSetupCheckpoint(sqlite3rbu *p, RbuState *pState){
       }else{
         p->nPagePerSector = 1;
       }
+
+      /* Call xSync() on the wal file. This causes SQLite to sync the 
+      ** directory in which the target database and the wal file reside, in 
+      ** case it has not been synced since the rename() call in 
+      ** rbuMoveOalFile(). */
+      p->rc = pWal->pMethods->xSync(pWal, SQLITE_SYNC_NORMAL);
     }
   }
 }
index 8ace7675fdc89f91686bce11ffa16fcdb9dddf68..b06ed90284f89d141c12f43b070f60567542cfb1 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Fix\sa\sbug\sin\sthe\s'start\sof\s...'\sdate/time\smodifiers\swhen\sthey\sfollow\sa\njulian\sday\snumber.\s\sFix\sfor\sticket\s[6097cb92745327a1].
-D 2017-03-02T23:40:21.740
+C Before\sbeginning\san\sincremental\scheckpoint\sin\sRBU,\ssync\sthe\sdirectory\ncontaining\sthe\starget\sdatabase\sfile.\sThis\sensures\sthat\sthe\snew\sdirectory\sentry\ncreated\sby\srenaming\sthe\s*-oal\sfile\sto\s*-wal\sis\ssynced\sto\sdisk.
+D 2017-03-03T16:51:46.903
 F Makefile.in edb6bcdd37748d2b1c3422ff727c748df7ffe918
 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
 F Makefile.msc a89ea37ab5928026001569f056973b9059492fe2
@@ -263,7 +263,7 @@ F ext/rbu/rburesume.test 8acb77f4a422ff55acfcfc9cc15a5cb210b1de83
 F ext/rbu/rbusave.test 0f43b6686084f426ddd040b878426452fd2c2f48
 F ext/rbu/rbuvacuum.test 4a977447c15c2581ab668781d9ef4294382530e0
 F ext/rbu/rbuvacuum2.test 2074ab14fe66e1c7e7210c62562650dcd215bbaa
-F ext/rbu/sqlite3rbu.c cba23db39792175295b94ad0086825894b617921
+F ext/rbu/sqlite3rbu.c 2a89efba9eeba8e6c89a498dc195e8efbdde2694
 F ext/rbu/sqlite3rbu.h 6fb6294c34a9ca93b5894a33bca530c6f08decba
 F ext/rbu/test_rbu.c 5aa22616afac6f71ebd3d9bc9bf1006cfabcca88
 F ext/rtree/README 6315c0d73ebf0ec40dedb5aa0e942bc8b54e3761
@@ -1560,7 +1560,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
 F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
 F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P 4012bb3aa91927156ba149caa4e5c622b0729d79
-R 106d75876c31ad808988639b89376fd6
-U drh
-Z d7eafab06f2b8ece511ab9317c8fe2f8
+P 081dbcfb6d82528cefecb36c4491fa6e1a790b17
+R c49d10bdecee819ceb83b85a5e3f8244
+U dan
+Z 0d48f0e17be43a572b386c16c35f7b42
index 9e61a74210bb605d7c7f4b8dc3415d07b4411d3f..91442ae41385f2651051e15f3ab2cec8c57a6262 100644 (file)
@@ -1 +1 @@
-081dbcfb6d82528cefecb36c4491fa6e1a790b17
\ No newline at end of file
+915a9a28783fbb2f4c0794eb4264ce8c0b9d42f7
\ No newline at end of file