Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Generate extra log messages in response to irregularites in the pointer-map used by "BEGIN CONCURRENT" transactions. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | begin-concurrent |
Files: | files | file ages | folders |
SHA3-256: |
f7e3e2bc88f110d9282ce5d2fa58580c |
User & Date: | dan 2017-05-31 17:06:13.603 |
Context
2017-06-02
| ||
09:31 | Extend even further the logging designed to find problems in the pointer-map structure. Call abort() to dump a core as soon as such a problem is seen. (check-in: f131677dcb user: dan tags: begin-concurrent) | |
2017-05-31
| ||
17:06 | Generate extra log messages in response to irregularites in the pointer-map used by "BEGIN CONCURRENT" transactions. (check-in: f7e3e2bc88 user: dan tags: begin-concurrent) | |
2017-05-29
| ||
19:23 | Instead of a root page number, log the object (table or index) name if a page level locking conflict is detected. (check-in: 9ad846e57b user: dan tags: begin-concurrent) | |
Changes
Changes to src/btree.c.
︙ | ︙ | |||
625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 | sqlite3_free(pMap->aRollback); sqlite3_free(pMap->aPtr); sqlite3_free(pMap->aSvpt); sqlite3_free(pMap); pBt->pMap = 0; } } #else /* SQLITE_OMIT_CONCURRENT */ # define btreePtrmapAllocate(x) SQLITE_OK # define btreePtrmapDelete(x) # define btreePtrmapBegin(x,y) SQLITE_OK # define btreePtrmapEnd(x,y,z) #endif /* SQLITE_OMIT_CONCURRENT */ static void releasePage(MemPage *pPage); /* Forward reference */ /* ***** This routine is used inside of assert() only **** ** | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 | sqlite3_free(pMap->aRollback); sqlite3_free(pMap->aPtr); sqlite3_free(pMap->aSvpt); sqlite3_free(pMap); pBt->pMap = 0; } } static void btreeCheckPtrmap(BtShared *p, int nPage, const char *zLog){ BtreePtrmap *pMap = p->pMap; if( pMap ){ int n = MIN(1 + nPage - (int)pMap->iFirst, 5); int i; for(i=0; i<n; i++){ int eType = pMap->aPtr[i].eType; if( (eType==PTRMAP_OVERFLOW1 || eType==PTRMAP_OVERFLOW2 || eType==PTRMAP_BTREE) && pMap->aPtr[i].parent==0 ){ sqlite3_log(SQLITE_ERROR, "Bitvec: error at (%s) - (%d/%d %d/%d %d/%d %d/%d %d/%d)", zLog, (int)pMap->aPtr[0].eType, (int)pMap->aPtr[0].parent, (n>1 ? (int)pMap->aPtr[1].eType : -1), (n>1 ? (int)pMap->aPtr[1].parent : -1), (n>2 ? (int)pMap->aPtr[2].eType : -1), (n>2 ? (int)pMap->aPtr[2].parent : -1), (n>3 ? (int)pMap->aPtr[3].eType : -1), (n>3 ? (int)pMap->aPtr[3].parent : -1), (n>4 ? (int)pMap->aPtr[4].eType : -1), (n>4 ? (int)pMap->aPtr[4].parent : -1) ); break; } } } } #else /* SQLITE_OMIT_CONCURRENT */ # define btreePtrmapAllocate(x) SQLITE_OK # define btreePtrmapDelete(x) # define btreePtrmapBegin(x,y) SQLITE_OK # define btreePtrmapEnd(x,y,z) # define btreeCheckPtrmap(a,b,c) #endif /* SQLITE_OMIT_CONCURRENT */ static void releasePage(MemPage *pPage); /* Forward reference */ /* ***** This routine is used inside of assert() only **** ** |
︙ | ︙ | |||
4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 | /* If page 1 of the database is not writable, then no pages were allocated ** or freed by this transaction. In this case no special handling is ** required. Otherwise, if page 1 is dirty, proceed. */ BtreePtrmap *pMap = pBt->pMap; Pgno iTrunk = get4byte(&p1[32]); Pgno nPage = btreePagecount(pBt); u32 nFree = get4byte(&p1[36]); assert( pBt->pMap ); rc = sqlite3PagerUpgradeSnapshot(pPager, pPage1->pDbPage); assert( p1==pPage1->aData ); if( rc==SQLITE_OK ){ Pgno nHPage = get4byte(&p1[28]); | > > | 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 | /* If page 1 of the database is not writable, then no pages were allocated ** or freed by this transaction. In this case no special handling is ** required. Otherwise, if page 1 is dirty, proceed. */ BtreePtrmap *pMap = pBt->pMap; Pgno iTrunk = get4byte(&p1[32]); Pgno nPage = btreePagecount(pBt); u32 nFree = get4byte(&p1[36]); btreeCheckPtrmap(pBt, nPage, "btreeFixUnlocked(1)"); assert( pBt->pMap ); rc = sqlite3PagerUpgradeSnapshot(pPager, pPage1->pDbPage); assert( p1==pPage1->aData ); if( rc==SQLITE_OK ){ Pgno nHPage = get4byte(&p1[28]); |
︙ | ︙ | |||
8670 8671 8672 8673 8674 8675 8676 8677 8678 8679 8680 8681 8682 8683 | pCur->eState = CURSOR_REQUIRESEEK; pCur->nKey = pX->nKey; } } assert( pCur->apPage[pCur->iPage]->nOverflow==0 ); end_insert: return rc; } /* ** Delete the entry that the cursor is pointing to. ** ** If the BTREE_SAVEPOSITION bit of the flags parameter is zero, then | > | 8706 8707 8708 8709 8710 8711 8712 8713 8714 8715 8716 8717 8718 8719 8720 | pCur->eState = CURSOR_REQUIRESEEK; pCur->nKey = pX->nKey; } } assert( pCur->apPage[pCur->iPage]->nOverflow==0 ); end_insert: btreeCheckPtrmap(pBt, pBt->nPage, "sqlite3BtreeInsert()"); return rc; } /* ** Delete the entry that the cursor is pointing to. ** ** If the BTREE_SAVEPOSITION bit of the flags parameter is zero, then |
︙ | ︙ | |||
8841 8842 8843 8844 8845 8846 8847 8848 8849 8850 8851 8852 8853 8854 | }else{ rc = moveToRoot(pCur); if( bPreserve ){ pCur->eState = CURSOR_REQUIRESEEK; } } } return rc; } /* ** Create a new BTree table. Write into *piTable the page ** number for the root page of the new table. ** | > | 8878 8879 8880 8881 8882 8883 8884 8885 8886 8887 8888 8889 8890 8891 8892 | }else{ rc = moveToRoot(pCur); if( bPreserve ){ pCur->eState = CURSOR_REQUIRESEEK; } } } btreeCheckPtrmap(pBt, pBt->nPage, "sqlite3BtreeInsert()"); return rc; } /* ** Create a new BTree table. Write into *piTable the page ** number for the root page of the new table. ** |
︙ | ︙ |
Changes to test/concurrent3.test.
︙ | ︙ | |||
22 23 24 25 26 27 28 | ifcapable !concurrent { finish_test return } db close sqlite3_shutdown | | | | 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | ifcapable !concurrent { finish_test return } db close sqlite3_shutdown test_sqlite3_log xLog proc xLog {error_code msg} { puts "$error_code: $msg" } reset_db proc create_schema {} { db eval { PRAGMA journal_mode = wal; CREATE TABLE t1(x, y); |
︙ | ︙ |