From 0e9b43ff853afe97b416e4bd3866f0d27ea985d8 Mon Sep 17 00:00:00 2001 From: dan Date: Fri, 3 Mar 2017 16:51:46 +0000 Subject: [PATCH] Before beginning an incremental checkpoint in RBU, sync the directory 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 | 7 +++++++ manifest | 14 +++++++------- manifest.uuid | 2 +- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/ext/rbu/sqlite3rbu.c b/ext/rbu/sqlite3rbu.c index 163a544259..7dd232b4b5 100644 --- a/ext/rbu/sqlite3rbu.c +++ b/ext/rbu/sqlite3rbu.c @@ -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); } } } diff --git a/manifest b/manifest index 8ace7675fd..b06ed90284 100644 --- 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 diff --git a/manifest.uuid b/manifest.uuid index 9e61a74210..91442ae413 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -081dbcfb6d82528cefecb36c4491fa6e1a790b17 \ No newline at end of file +915a9a28783fbb2f4c0794eb4264ce8c0b9d42f7 \ No newline at end of file