Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Instead of a root page number, log the object (table or index) name if a page level locking conflict is detected. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | begin-concurrent |
Files: | files | file ages | folders |
SHA3-256: |
9ad846e57bd427adc7c29768cabca189 |
User & Date: | dan 2017-05-29 19:23:56.135 |
Context
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) | |
14:27 | Enhance the log messages emitted when a page conflict is detected. (check-in: 92618492b0 user: dan tags: begin-concurrent) | |
Changes
Changes to src/btree.c.
︙ | |||
10282 10283 10284 10285 10286 10287 10288 10289 10290 10291 | 10282 10283 10284 10285 10286 10287 10288 10289 10290 10291 10292 10293 10294 10295 10296 10297 10298 10299 10300 10301 10302 10303 10304 10305 10306 10307 10308 10309 10310 10311 10312 10313 10314 10315 10316 10317 10318 10319 10320 10321 10322 10323 10324 10325 10326 10327 10328 10329 10330 10331 10332 10333 10334 10335 10336 10337 10338 10339 10340 10341 10342 10343 10344 10345 10346 10347 10348 10349 | + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | ** obtained for an CONCURRENT transaction due to a conflict with an already ** committed transaction, SQLITE_BUSY_SNAPSHOT is returned. Otherwise, if ** some other error (OOM, IO, etc.) occurs, the relevant SQLite error code ** is returned. */ int sqlite3BtreeExclusiveLock(Btree *p){ int rc; Pgno pgno = 0; BtShared *pBt = p->pBt; assert( p->inTrans==TRANS_WRITE && pBt->pPage1 ); sqlite3BtreeEnter(p); |
︙ |
Changes to src/pager.c.
︙ | |||
4262 4263 4264 4265 4266 4267 4268 | 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 | - + | assert( pPager->eState==PAGER_WRITER_CACHEMOD || pPager->eState==PAGER_WRITER_DBMOD ); assert( assert_pager_state(pPager) ); assert( !pagerUseWal(pPager) ); |
︙ | |||
6343 6344 6345 6346 6347 6348 6349 | 6343 6344 6345 6346 6347 6348 6349 6350 6351 6352 6353 6354 6355 6356 6357 6358 6359 6360 6361 6362 6363 6364 6365 6366 6367 6368 6369 6370 6371 6372 6373 6374 6375 6376 6377 6378 6379 | - + - + + + | ** If the required locks are already held or successfully obtained and ** the transaction can be committed, SQLITE_OK is returned. If a required lock ** cannot be obtained, SQLITE_BUSY is returned. Or, if the current transaction ** is CONCURRENT and cannot be committed due to a conflict, SQLITE_BUSY_SNAPSHOT ** is returned. Otherwise, if some other error occurs (IO error, OOM etc.), ** and SQLite error code is returned. */ |
︙ |
Changes to src/pager.h.
︙ | |||
160 161 162 163 164 165 166 | 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 | - + | void *sqlite3PagerGetData(DbPage *); void *sqlite3PagerGetExtra(DbPage *); /* Functions used to manage pager transactions and savepoints. */ void sqlite3PagerPagecount(Pager*, int*); int sqlite3PagerBegin(Pager*, int exFlag, int); int sqlite3PagerCommitPhaseOne(Pager*,const char *zMaster, int); |
︙ |
Changes to src/wal.c.
︙ | |||
239 240 241 242 243 244 245 | 239 240 241 242 243 244 245 246 247 248 249 250 251 252 | - | ** When a rollback occurs, the value of K is decreased. Hash table entries ** that correspond to frames greater than the new K value are removed ** from the hash table at this point. */ #ifndef SQLITE_OMIT_WAL #include "wal.h" |
︙ | |||
2853 2854 2855 2856 2857 2858 2859 | 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 | - + + + + + + | ** If no error occurs and the caller may proceed with committing the ** transaction, SQLITE_OK is returned. SQLITE_BUSY is returned if the WRITER ** lock cannot be obtained. Or, if the WRITER lock can be obtained but there ** are conflicts with a committed transaction, SQLITE_BUSY_SNAPSHOT. Finally, ** if an error (i.e. an OOM condition or IO error), an SQLite error code ** is returned. */ |
︙ | |||
2913 2914 2915 2916 2917 2918 2919 | 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 | - - - - - - - - - - - - - - - + - - - - | sz = (sz&0xfe00) + ((sz&0x0001)<<16); iOffset = walFrameOffset(i+iZero, sz) + WAL_FRAME_HDRSIZE + 40; rc = sqlite3OsRead(pWal->pWalFd, aNew, sizeof(aNew), iOffset); if( rc==SQLITE_OK && memcmp(aOld, aNew, sizeof(aNew)) ){ rc = SQLITE_BUSY_SNAPSHOT; } }else if( sqlite3BitvecTestNotNull(pAllRead, aPgno[i]) ){ |
︙ |
Changes to src/wal.h.
︙ | |||
132 133 134 135 136 137 138 | 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 | - + | int sqlite3WalSnapshotGet(Wal *pWal, sqlite3_snapshot **ppSnapshot); void sqlite3WalSnapshotOpen(Wal *pWal, sqlite3_snapshot *pSnapshot); int sqlite3WalSnapshotRecover(Wal *pWal); #endif #ifndef SQLITE_OMIT_CONCURRENT /* Tell the wal layer that we want to commit a concurrent transaction */ |
︙ |
Changes to test/concurrent5.test.
︙ | |||
55 56 57 58 59 60 61 | 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 | - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + | db eval { INSERT INTO t1 VALUES(randomblob(200), randomblob(200)); } catchsql COMMIT db2 } {1 {database is locked}} do_test_conflict_msg 1.1.2 { |