SQLite

Check-in [118aa7e32a]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Enhance the wal2 header comment in wal.c to explain how the wal-hook is invoked in wal2 mode.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | wal2
Files: files | file ages | folders
SHA3-256: 118aa7e32a94ad971a955ab60db5bfc5b6241f93734a41ba83ab72ea71bc9aaa
User & Date: dan 2018-12-22 15:50:00.221
Context
2018-12-26
19:10
Merge latest trunk changes with this branch. (check-in: 404f9d99d3 user: dan tags: wal2)
2018-12-22
15:50
Enhance the wal2 header comment in wal.c to explain how the wal-hook is invoked in wal2 mode. (check-in: 118aa7e32a user: dan tags: wal2)
2018-12-17
15:22
Add extra test case to wal2recover.test. (check-in: 1a5aa73435 user: dan tags: wal2)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/wal.c.
301
302
303
304
305
306
307

























308
309
310
311
312
313
314
**
** The wal file that writers are currently appending to (the one they
** don't have to check the above two criteria before writing to) is called
** the "current" wal file.
**
** The first wal file takes the same name as the wal file in legacy wal
** mode systems - "<db>-wal". The second is named "<db>-wal2".

























**
** WAL FILE FORMAT
**
** The file format used for each wal file in wal2 mode is the same as for
** legacy wal mode.  Except, the file format field is set to 3021000 
** instead of 3007000.
**







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
**
** The wal file that writers are currently appending to (the one they
** don't have to check the above two criteria before writing to) is called
** the "current" wal file.
**
** The first wal file takes the same name as the wal file in legacy wal
** mode systems - "<db>-wal". The second is named "<db>-wal2".
**
** CHECKPOINTS
**
** The "pre-configured size" mentioned above is the value set by 
** "PRAGMA journal_size_limit". Or, if journal_size_limit is not set, 
** 1000 pages.
**
** There is only a single type of checkpoint in wal2 mode (no "truncate",
** "restart" etc.), and it always checkpoints the entire contents of a single
** wal file. A wal file cannot be checkpointed until after a writer has written
** the first transaction into the other wal file and all readers are reading a
** snapshot that includes at least one transaction from the other wal file.
**
** The wal-hook, if one is registered, is invoked after a write-transaction
** is committed, just as it is in legacy wal mode. The integer parameter
** passed to the wal-hook is the total number of uncheckpointed frames in both
** wal files. Except, the parameter is set to zero if there is no frames 
** that may be checkpointed. This happens in two scenarios:
**
**   1. The "other" wal file (the one that the writer did not just append to)
**      is completely empty, or
**
**   2. The "other" wal file (the one that the writer did not just append to)
**      has already been checkpointed.
**
**
** WAL FILE FORMAT
**
** The file format used for each wal file in wal2 mode is the same as for
** legacy wal mode.  Except, the file format field is set to 3021000 
** instead of 3007000.
**