mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
Enhance the wal.c source file with an ASCII-art schematic of the -shm file
header. FossilOrigin-Name: a6c160e08a61d105f8aab959440ac5ec4f1aaca8f0d393e08e7c2c67815b5bb2
This commit is contained in:
64
src/wal.c
64
src/wal.c
@@ -400,6 +400,70 @@ struct WalCkptInfo {
|
||||
};
|
||||
#define READMARK_NOT_USED 0xffffffff
|
||||
|
||||
/*
|
||||
** This is a schematic view of the complete 136-byte header of the
|
||||
** wal-index file (also known as the -shm file):
|
||||
**
|
||||
** +-----------------------------+
|
||||
** 0: | iVersion | \
|
||||
** +-----------------------------+ |
|
||||
** 4: | (unused padding) | |
|
||||
** +-----------------------------+ |
|
||||
** 8: | iChange | |
|
||||
** +-------+-------+-------------+ |
|
||||
** 12: | bInit | bBig | szPage | |
|
||||
** +-------+-------+-------------+ |
|
||||
** 16: | mxFrame | | First copy of the
|
||||
** +-----------------------------+ | WalIndexHdr object
|
||||
** 20: | nPage | |
|
||||
** +-----------------------------+ |
|
||||
** 24: | aFrameCksum | |
|
||||
** | | |
|
||||
** +-----------------------------+ |
|
||||
** 32: | aSalt | |
|
||||
** | | |
|
||||
** +-----------------------------+ |
|
||||
** 40: | aCksum | |
|
||||
** | | /
|
||||
** +-----------------------------+
|
||||
** 48: | iVersion | \
|
||||
** +-----------------------------+ |
|
||||
** 52: | (unused padding) | |
|
||||
** +-----------------------------+ |
|
||||
** 56: | iChange | |
|
||||
** +-------+-------+-------------+ |
|
||||
** 60: | bInit | bBig | szPage | |
|
||||
** +-------+-------+-------------+ | Second copy of the
|
||||
** 64: | mxFrame | | WalIndexHdr
|
||||
** +-----------------------------+ |
|
||||
** 68: | nPage | |
|
||||
** +-----------------------------+ |
|
||||
** 72: | aFrameCksum | |
|
||||
** | | |
|
||||
** +-----------------------------+ |
|
||||
** 80: | aSalt | |
|
||||
** | | |
|
||||
** +-----------------------------+ |
|
||||
** 88: | aCksum | |
|
||||
** | | /
|
||||
** +-----------------------------+
|
||||
** 96: | nBackfill |
|
||||
** +-----------------------------+
|
||||
** 100: | 5 read marks |
|
||||
** | |
|
||||
** | |
|
||||
** | |
|
||||
** | |
|
||||
** +-------+-------+------+------+
|
||||
** 120: | Write | Ckpt | Rcvr | Rd0 | \
|
||||
** +-------+-------+------+------+ ) 8 lock bytes
|
||||
** | Read1 | Read2 | Rd3 | Rd4 | /
|
||||
** +-------+-------+------+------+
|
||||
** 128: | nBackfillAttempted |
|
||||
** +-----------------------------+
|
||||
** 132: | (unused padding) |
|
||||
** +-----------------------------+
|
||||
*/
|
||||
|
||||
/* A block of WALINDEX_LOCK_RESERVED bytes beginning at
|
||||
** WALINDEX_LOCK_OFFSET is reserved for locks. Since some systems
|
||||
|
Reference in New Issue
Block a user