/ Check-in [67484807]
Login

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

Overview
Comment:Call fsync() right after ftruncate() when in journal_mode=TRUNCATE and when synchronous=FULL in order to ensure that transactions are durable across a power loss that happens moments after the commit. Proposed fix for https://bugzilla.mozilla.org/show_bug.cgi?id=1072773. This is a cherry-pick of [3e922208b68563]
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | branch-3.8.6
Files: files | file ages | folders
SHA1:674848070ec296874f555aaaea511987648bf94e
User & Date: drh 2014-10-22 02:43:14
Context
2014-10-22
03:00
Update the version number to 3.8.6.1 check-in: cad7f8d6 user: drh tags: branch-3.8.6
02:43
Call fsync() right after ftruncate() when in journal_mode=TRUNCATE and when synchronous=FULL in order to ensure that transactions are durable across a power loss that happens moments after the commit. Proposed fix for https://bugzilla.mozilla.org/show_bug.cgi?id=1072773. This is a cherry-pick of [3e922208b68563] check-in: 67484807 user: drh tags: branch-3.8.6
2014-10-21
21:56
Call fsync() right after ftruncate() when in journal_mode=TRUNCATE and when synchronous=FULL in order to ensure that transactions are durable across a power loss that happens moments after the commit. Proposed fix for https://bugzilla.mozilla.org/show_bug.cgi?id=1072773. check-in: 3e922208 user: drh tags: trunk
2014-08-15
11:46
Version 3.8.6 check-in: 9491ba7d user: drh tags: trunk, release, version-3.8.6
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/pager.c.

  1952   1952         assert( pPager->journalMode==PAGER_JOURNALMODE_MEMORY );
  1953   1953         sqlite3OsClose(pPager->jfd);
  1954   1954       }else if( pPager->journalMode==PAGER_JOURNALMODE_TRUNCATE ){
  1955   1955         if( pPager->journalOff==0 ){
  1956   1956           rc = SQLITE_OK;
  1957   1957         }else{
  1958   1958           rc = sqlite3OsTruncate(pPager->jfd, 0);
         1959  +        if( rc==SQLITE_OK && pPager->fullSync ){
         1960  +          /* Make sure the new file size is written into the inode right away.
         1961  +          ** Otherwise the journal might resurrect following a power loss and
         1962  +          ** cause the last transaction to roll back.  See
         1963  +          ** https://bugzilla.mozilla.org/show_bug.cgi?id=1072773
         1964  +          */
         1965  +          rc = sqlite3OsSync(pPager->jfd, pPager->syncFlags);
         1966  +        }
  1959   1967         }
  1960   1968         pPager->journalOff = 0;
  1961   1969       }else if( pPager->journalMode==PAGER_JOURNALMODE_PERSIST
  1962   1970         || (pPager->exclusiveMode && pPager->journalMode!=PAGER_JOURNALMODE_WAL)
  1963   1971       ){
  1964   1972         rc = zeroJournalHdr(pPager, hasMaster);
  1965   1973         pPager->journalOff = 0;