]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake: persist_data: Enable Write Ahead Log
authorJoshua Watt <jpewhacker@gmail.com>
Tue, 4 Dec 2018 03:42:32 +0000 (21:42 -0600)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 7 Dec 2018 12:38:58 +0000 (12:38 +0000)
Enabling the write ahead log improves database reliability, speeds up
writes (since they mostly happen sequentially), and speeds up readers
(since they are no longer blocked by most write operations). The
persistent database is very read heavy, so the auto-checkpoint size is
reduced from the default (usually 1000) to 100 so that reads remain
fast.

[YOCTO #13030]

(Bitbake rev: 79100fa67539f9654af9bf6d3e6842eb5c12e989)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake/lib/bb/persist_data.py

index 2bc3e766a93cf02987d442f8983ad05cb58be45b..14927920908acbde504d8c403636814344ea7f5e 100644 (file)
@@ -279,6 +279,11 @@ class PersistData(object):
 def connect(database):
     connection = sqlite3.connect(database, timeout=5)
     connection.execute("pragma synchronous = off;")
+    # Enable WAL and keep the autocheckpoint length small (the default is
+    # usually 1000). Persistent caches are usually read-mostly, so keeping
+    # this short will keep readers running quickly
+    connection.execute("pragma journal_mode = WAL;")
+    connection.execute("pragma wal_autocheckpoint = 100;")
     connection.text_factory = str
     return connection