comparison doc/upgrading.txt @ 6930:a96a239db0d9

Set all sqlite db's to WAL mode on creation Complete work done on 6917:fba76e0bba98. WAL journaling mode now enabled on primary db as well as session db's when using sqlite for session databases. Made change to WAL mode more robust for testing by bracketing `pragma journal_mode=wal` with commit() calls. Normally the conversion would occur when a new session was opened, but this commits the changes explicitly to make all the tests stable. Also added doc on this.
author John Rouillard <rouilj@ieee.org>
date Thu, 08 Sep 2022 01:12:12 -0400
parents 1319ab13f286
children bd2c3b2010c3
comparison
equal deleted inserted replaced
6929:581b09777eba 6930:a96a239db0d9
121 Session Databases`_ in the `administration guide`_ 121 Session Databases`_ in the `administration guide`_
122 122
123 123
124 .. _Using Redis for Session Databases: 124 .. _Using Redis for Session Databases:
125 admin_guide.html#using-redis-for-session-databases 125 admin_guide.html#using-redis-for-session-databases
126
127 New SQLite databases created with WAL mode journaling (optional)
128 ----------------------------------------------------------------
129
130 By default, SQLite databases use a rollback journal when
131 writing an update. The rollback journal stores a copy of the
132 data from before the update. One downside of this is that
133 all reads have to be suspended while a write is
134 occurring. SQLite has an alternate way of insuring ACID
135 compliance by using a WAL (write ahead log) journal.
136
137 Version 2.3.0 of Roundup, creates new SQLite databases using
138 WAL journaling. With WAL, a writer does not block readers
139 and readers do not block writing an update. This keeps
140 Roundup accessible even under a heavy write load (e.g. when
141 bulk loading data or automated updates via REST).
142
143 If you want to convert your existing SQLite db to WAL mode:
144
145 1. check the current journal mode on your database
146 using::
147
148 sqlite3 <tracker_home>/db/db "pragma journal_mode;"
149
150 2. If it returns ``delete``, change it to WAL mode using::
151
152 sqlite3 <tracker_home>/db/db "pragma journal_mode=WAL;"
153
154 3. verify by running the command in step 1 again and you
155 should get ``wal``.
156
157 If you are using SQLite for session and otk databases,
158 perform the same steps replacing ``db`` with ``db-session``
159 and ``db-otk``.
160
161 If you find WAL mode is not working for you, you can set the
162 journal method to a rollback journal (``delete`` mode) by
163 using step 2 and replacing ``wal`` with ``delete``. (Note:
164 SQLite supports other journaling modes, but only ``wal`` and
165 ``delete`` persist. Roundup doesn't set a journaling mode
166 when it opens the database, so options such as ``truncate``
167 are not used.)
168
169 For details on WAL mode see `<https://www.sqlite.org/wal.html>`_
170 and `<https://www.sqlite.org/pragma.html#pragma_journal_mode>`_.
126 171
127 .. index:: Upgrading; 2.1.0 to 2.2.0 172 .. index:: Upgrading; 2.1.0 to 2.2.0
128 173
129 Migrating from 2.1.0 to 2.2.0 174 Migrating from 2.1.0 to 2.2.0
130 ============================= 175 =============================

Roundup Issue Tracker: http://roundup-tracker.org/