/ Check-in [1c318ef3]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Revise change from the previous check-in to clarify the situation when handling open journal files, regardless of journal mode.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:1c318ef3b76e9a9a5ff2f156a9acddfc1bda0949
User & Date: mistachkin 2014-03-07 03:31:35
Context
2014-03-07
14:57
Improved comment on the pager.c PERSIST rollback journal delete logic inside of hasHotJournal(). No changes to code. check-in: e5b17a9d user: drh tags: trunk
14:36
Merge the fix for the journal_mode=PERSIST error recovery delay bug. check-in: bb6a75f4 user: drh tags: sessions
03:31
Revise change from the previous check-in to clarify the situation when handling open journal files, regardless of journal mode. check-in: 1c318ef3 user: mistachkin tags: trunk
02:29
Avoid calling sqlite3OsDelete() on a file that is open, since this causes Windows to run *very* slowly. Comes up on error recovery in journal_mode=PERSIST. check-in: fdc651e2 user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/pager.c.

  4893   4893         ** and the journal is not being persisted, then delete the journal
  4894   4894         ** file.  See the header comment above for the reasoning here.
  4895   4895         ** Delete the obsolete journal file under a RESERVED lock to avoid
  4896   4896         ** race conditions and to avoid violating [H33020].
  4897   4897         */
  4898   4898         rc = pagerPagecount(pPager, &nPage);
  4899   4899         if( rc==SQLITE_OK ){
  4900         -        if( nPage==0 && pPager->journalMode!=PAGER_JOURNALMODE_PERSIST ){
         4900  +        if( nPage==0 && !jrnlOpen ){
  4901   4901             sqlite3BeginBenignMalloc();
  4902   4902             if( pagerLockDb(pPager, RESERVED_LOCK)==SQLITE_OK ){
  4903   4903               sqlite3OsDelete(pVfs, pPager->zJournal, 0);
  4904   4904               if( !pPager->exclusiveMode ) pagerUnlockDb(pPager, SHARED_LOCK);
  4905   4905             }
  4906   4906             sqlite3EndBenignMalloc();
  4907   4907           }else{