/ Check-in [3e922208]
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.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:3e922208b68563489c7766abb9afb4885113e7b8
User & Date: drh 2014-10-21 21:56:06
References
2014-10-29
01:07
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 cherrypick of [3e922208b68563489]. check-in: a8f9bd1e user: drh tags: branch-3.8.7
2014-10-22
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
Context
2014-10-29
01:07
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 cherrypick of [3e922208b68563489]. check-in: a8f9bd1e user: drh tags: branch-3.8.7
2014-10-22
15:27
Take steps to avoid misestimating range query costs based on STAT4 data due to the roundoff error of converting from integers to LogEst and back to integers. check-in: 3c933bf9 user: drh tags: trunk
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
18:16
Further tuning of the cost estimates for skip-scan loops, especially for cases when skip-scan loops are in competition with regular loops. check-in: a27861c2 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/pager.c.

  1937   1937         assert( pPager->journalMode==PAGER_JOURNALMODE_MEMORY );
  1938   1938         sqlite3OsClose(pPager->jfd);
  1939   1939       }else if( pPager->journalMode==PAGER_JOURNALMODE_TRUNCATE ){
  1940   1940         if( pPager->journalOff==0 ){
  1941   1941           rc = SQLITE_OK;
  1942   1942         }else{
  1943   1943           rc = sqlite3OsTruncate(pPager->jfd, 0);
         1944  +        if( rc==SQLITE_OK && pPager->fullSync ){
         1945  +          /* Make sure the new file size is written into the inode right away.
         1946  +          ** Otherwise the journal might resurrect following a power loss and
         1947  +          ** cause the last transaction to roll back.  See
         1948  +          ** https://bugzilla.mozilla.org/show_bug.cgi?id=1072773
         1949  +          */
         1950  +          rc = sqlite3OsSync(pPager->jfd, pPager->syncFlags);
         1951  +        }
  1944   1952         }
  1945   1953         pPager->journalOff = 0;
  1946   1954       }else if( pPager->journalMode==PAGER_JOURNALMODE_PERSIST
  1947   1955         || (pPager->exclusiveMode && pPager->journalMode!=PAGER_JOURNALMODE_WAL)
  1948   1956       ){
  1949   1957         rc = zeroJournalHdr(pPager, hasMaster);
  1950   1958         pPager->journalOff = 0;