SQLite

Check-in [b10ec14ef7]
Login

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

Overview
Comment:Fix for builds without SQLITE_ENABLE_BATCH_ATOMIC_WRITE.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | exp-retry-atomic-commit
Files: files | file ages | folders
SHA3-256: b10ec14ef7edcc5d7b0ad298c8230d1eca5508e8cf673fbbc97a0928b76c92fb
User & Date: dan 2018-07-17 13:55:08.594
Context
2018-07-17
14:01
If an SQLITE_IOERR error is encountered as part of an atomic commit on an F2FS file-system, retry the commit in legacy journal mode. (check-in: 2e0357c2ed user: dan tags: trunk)
13:55
Fix for builds without SQLITE_ENABLE_BATCH_ATOMIC_WRITE. (Closed-Leaf check-in: b10ec14ef7 user: dan tags: exp-retry-atomic-commit)
2018-07-16
20:44
Add new file doc/F2FS.txt, containing notes on the way SQLite uses the F2FS atomic commit feature. (check-in: 59efb1bfab user: dan tags: exp-retry-atomic-commit)
Changes
Unified Diff Show Whitespace Changes Patch
Changes to src/pager.c.
6495
6496
6497
6498
6499
6500
6501

6502
6503
6504
6505
6506
6507
6508
      ** not the case. In this case it is likely enough that the redundant
      ** xSync() call will be changed to a no-op by the OS anyhow. 
      */
      rc = syncJournal(pPager, 0);
      if( rc!=SQLITE_OK ) goto commit_phase_one_exit;

      pList = sqlite3PcacheDirtyList(pPager->pPCache);

      if( bBatch ){
        rc = sqlite3OsFileControl(fd, SQLITE_FCNTL_BEGIN_ATOMIC_WRITE, 0);
        if( rc==SQLITE_OK ){
          rc = pager_write_pagelist(pPager, pList);
          if( rc==SQLITE_OK ){
            rc = sqlite3OsFileControl(fd, SQLITE_FCNTL_COMMIT_ATOMIC_WRITE, 0);
          }







>







6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
      ** not the case. In this case it is likely enough that the redundant
      ** xSync() call will be changed to a no-op by the OS anyhow. 
      */
      rc = syncJournal(pPager, 0);
      if( rc!=SQLITE_OK ) goto commit_phase_one_exit;

      pList = sqlite3PcacheDirtyList(pPager->pPCache);
#ifdef SQLITE_ENABLE_BATCH_ATOMIC_WRITE
      if( bBatch ){
        rc = sqlite3OsFileControl(fd, SQLITE_FCNTL_BEGIN_ATOMIC_WRITE, 0);
        if( rc==SQLITE_OK ){
          rc = pager_write_pagelist(pPager, pList);
          if( rc==SQLITE_OK ){
            rc = sqlite3OsFileControl(fd, SQLITE_FCNTL_COMMIT_ATOMIC_WRITE, 0);
          }
6517
6518
6519
6520
6521
6522
6523

6524
6525
6526
6527
6528
6529
6530
            sqlite3OsClose(pPager->jfd);
          }
          bBatch = 0;
        }else{
          sqlite3OsClose(pPager->jfd);
        }
      }


      if( bBatch==0 && rc==SQLITE_OK ){
        rc = pager_write_pagelist(pPager, pList);
      }

      if( rc!=SQLITE_OK ){
        assert( rc!=SQLITE_IOERR_BLOCKED );







>







6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
            sqlite3OsClose(pPager->jfd);
          }
          bBatch = 0;
        }else{
          sqlite3OsClose(pPager->jfd);
        }
      }
#endif /* SQLITE_ENABLE_BATCH_ATOMIC_WRITE */

      if( bBatch==0 && rc==SQLITE_OK ){
        rc = pager_write_pagelist(pPager, pList);
      }

      if( rc!=SQLITE_OK ){
        assert( rc!=SQLITE_IOERR_BLOCKED );