Add a comment to wal.c to explain why a race condition is safe.

FossilOrigin-Name: bc33af866403c23d548dd4705675315810d52d7f
This commit is contained in:
dan 2015-04-13 17:43:43 +00:00
parent c01501a386
commit 1fe0af200d
3 changed files with 16 additions and 8 deletions

View File

@ -1,5 +1,5 @@
C Remove\sa\sfaulty\sassert()\sfrom\sthe\sbtree\sbalancing\slogic.
D 2015-04-13T14:44:01.870
C Add\sa\scomment\sto\swal.c\sto\sexplain\swhy\sa\srace\scondition\sis\ssafe.
D 2015-04-13T17:43:43.335
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 5f78b1ab81b64e7c57a75d170832443e66c0880a
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@ -304,7 +304,7 @@ F src/vdbesort.c 2e7f683464fd5db3be4beaa1ff2d39e24fcb64b8
F src/vdbetrace.c 7e4222955e07dd707a2f360c0eb73452be1cb010
F src/vtab.c 9ca557215e8591ceb66e0b7c0a579c6df1e54b2d
F src/vxworks.h c18586c8edc1bddbc15c004fa16aeb1e1342b4fb
F src/wal.c 878c8e1a51cb2ec45c395d26b7d5cd9e1a098e4a
F src/wal.c 753995db83247f20361a8e8a874990b21a75abd9
F src/wal.h df01efe09c5cb8c8e391ff1715cca294f89668a4
F src/walker.c c253b95b4ee44b21c406e2a1052636c31ea27804
F src/where.c 9952e4749f481707595692f2f13d3ce3b64ffdc8
@ -1250,7 +1250,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
P ce6eaac10a190b26b87bfe75918e2ef58fd7a3f9
R bac46adba95b910001781f1715fe4531
U drh
Z 344080508147bb8eb54111c6b1e074c7
P d06669d968c8f6af8799fbfeabadaab68b9b8db8
R 90c9a3885d268edb8b0fe9dee7687f08
U dan
Z a7fde54970dc241049366741c468ca23

View File

@ -1 +1 @@
d06669d968c8f6af8799fbfeabadaab68b9b8db8
bc33af866403c23d548dd4705675315810d52d7f

View File

@ -1730,6 +1730,14 @@ static int walCheckpoint(
mxSafeFrame = pWal->hdr.mxFrame;
mxPage = pWal->hdr.nPage;
for(i=1; i<WAL_NREADER; i++){
/* Thread-sanitizer reports that the following is an unsafe read,
** as some other thread may be in the process of updating the value
** of the aReadMark[] slot. The assumption here is that if that is
** happening, the other client may only be increasing the value,
** not decreasing it. So assuming either that either the "old" or
** "new" version of the value is read, and not some arbitrary value
** that would never be written by a real client, things are still
** safe. */
u32 y = pInfo->aReadMark[i];
if( mxSafeFrame>y ){
assert( y<=pWal->hdr.mxFrame );