“Wal2” mode in SQLite is similar to “wal” mode, but activating it requires a two-step process. First, the database must be changed to rollback mode, and then it can be changed to wal2 mode. A database in wal2 mode can only be accessed by versions of SQLite compiled from this specific branch. The advantage of wal2 mode is that it uses two wal files instead of one, which prevents the wal file from growing indefinitely if the checkpointer is interrupted. In wal2 mode, the checkpointer waits for writers to switch to the other wal file before performing a checkpoint. Application programming differences between wal and wal2 modes involve when and how the wal-hook is invoked.
https://www.sqlite.org/cgi/src/doc/wal2/doc/wal2.md