mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-10 01:02:56 +03:00
Add multi-threaded performance test program "tserver" to this branch. Fix bugs
in the begin-concurrent/wal2 integration revealed by the same. FossilOrigin-Name: 7bd3b35661d7d0e51113b9e4b15a0ab7f8e26edeafb43941ef5b44bb94df5109
This commit is contained in:
16
src/wal.c
16
src/wal.c
@@ -2435,7 +2435,10 @@ static int walCheckpoint(
|
||||
}
|
||||
|
||||
/* Release the reader lock held while backfilling */
|
||||
walUnlockExclusive(pWal, WAL_READ_LOCK(bWal2 ? 1 + iCkpt*2 : 0), 1);
|
||||
if( bWal2 ){
|
||||
walUnlockExclusive(pWal, WAL_READ_LOCK(1 + iCkpt*2), 1);
|
||||
}
|
||||
walUnlockExclusive(pWal, WAL_READ_LOCK(0), 1);
|
||||
}
|
||||
|
||||
if( rc==SQLITE_BUSY ){
|
||||
@@ -3861,11 +3864,16 @@ int sqlite3WalLockForCommit(
|
||||
u8 aNew[4];
|
||||
u8 *aOld = &((u8*)pPage1->pData)[40];
|
||||
int sz;
|
||||
i64 iOffset;
|
||||
i64 iOff;
|
||||
int iFrame = sLoc.iZero + i;
|
||||
int iWal = 0;
|
||||
if( bWal2 ){
|
||||
iWal = walExternalDecode(iFrame, &iFrame);
|
||||
}
|
||||
sz = pWal->hdr.szPage;
|
||||
sz = (sz&0xfe00) + ((sz&0x0001)<<16);
|
||||
iOffset = walFrameOffset(i+sLoc.iZero, sz)+WAL_FRAME_HDRSIZE+40;
|
||||
rc = sqlite3OsRead(pWal->apWalFd[0], aNew,sizeof(aNew),iOffset);
|
||||
iOff = walFrameOffset(iFrame, sz) + WAL_FRAME_HDRSIZE + 40;
|
||||
rc = sqlite3OsRead(pWal->apWalFd[iWal],aNew,sizeof(aNew),iOff);
|
||||
if( rc==SQLITE_OK && memcmp(aOld, aNew, sizeof(aNew)) ){
|
||||
rc = SQLITE_BUSY_SNAPSHOT;
|
||||
}
|
||||
|
Reference in New Issue
Block a user