More details on the comment justifying the aleged data race in the WAL-mode

checkpoint logic.

FossilOrigin-Name: 0fab65c79f675c825ed7e85c82b65ce6f990c9d0796ebb3886942d241df7b268
This commit is contained in:
drh 2019-11-27 20:40:44 +00:00
parent 2bbcaee833
commit 2ecf928ea9
3 changed files with 20 additions and 8 deletions

View File

@ -1,5 +1,5 @@
C Fix\svarious\sdocumentation\stypos\ssuggested\sby\sMark\sBenningfield.\nNo\schanges\sto\scode.
D 2019-11-26T14:24:12.657
C More\sdetails\son\sthe\scomment\sjustifying\sthe\saleged\sdata\srace\sin\sthe\sWAL-mode\ncheckpoint\slogic.
D 2019-11-27T20:40:44.618
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@ -609,7 +609,7 @@ F src/vdbesort.c a3be032cc3fee0e3af31773af4a7a6f931b7230a34f53282ccf1d9a2a72343b
F src/vdbetrace.c fa3bf238002f0bbbdfb66cc8afb0cea284ff9f148d6439bc1f6f2b4c3b7143f0
F src/vtab.c 108f79166d4a232a8bfb9d46e2fbec191f83a87fe97f7b93fc4de976c3fa3434
F src/vxworks.h d2988f4e5a61a4dfe82c6524dd3d6e4f2ce3cdb9
F src/wal.c bbd6838bd79c0a32144d482fb0b6a9d2d1a252fb3b16d5005ec30f2f80413b0d
F src/wal.c 15a2845769f51ba132f9cf0b2c7a6887a91fc8437892dbcce9fcdc68b66d60a1
F src/wal.h 606292549f5a7be50b6227bd685fa76e3a4affad71bb8ac5ce4cb5c79f6a176a
F src/walker.c a137468bf36c92e64d2275caa80c83902e3a0fc59273591b96c6416d3253d05d
F src/where.c 874845fb5d93b3bc07123df8fee805e9650bd091e3ed62988273c7e2141ab8bd
@ -1851,7 +1851,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P fefe2d046725254367f9f82a8c8cb137e8b75dbbf4bc48debf0649479ff2f0c2
R 2cbc86068e6280db02b2343a5ae4d180
P 08f09dc4f986a27f4e4e69f8226dbfaf0cfe1269cefc2830bf0fbef7b9bbda48
R b207e459d1be3160926607ccb6908528
U drh
Z bfb42d33cd846c85cfceaf8d7b65a29d
Z 775e94978b5046eb8d005a7d1a58936a

View File

@ -1 +1 @@
08f09dc4f986a27f4e4e69f8226dbfaf0cfe1269cefc2830bf0fbef7b9bbda48
0fab65c79f675c825ed7e85c82b65ce6f990c9d0796ebb3886942d241df7b268

View File

@ -1824,7 +1824,19 @@ static int walCheckpoint(
** 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. */
** safe.
**
** Astute readers have pointed out that the assumption stated in the
** last sentence of the previous paragraph is not guaranteed to be
** true for all conforming systems. However, the assumption is true
** for all compilers and architectures in common use today (circa
** 2019-11-27) and the alternatives are both slow and complex, and
** so we will continue to go with the current design for now. If this
** bothers you, or if you really are running on a system where aligned
** 32-bit reads and writes are not atomic, then you can simply avoid
** the use of WAL mode, or only use WAL mode together with
** PRAGMA locking_mode=EXCLUSIVE and all will be well.
*/
u32 y = pInfo->aReadMark[i];
if( mxSafeFrame>y ){
assert( y<=pWal->hdr.mxFrame );