mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 13:28:12 -05:00
installer: final: Delete SQLite WAL and shm files upon completion.
Previously, db.sqlite-{wal,shm} could be left behind after stopping guix-daemon. When resuming installation, SQLite could end up behaving as if transactions visible in the WAL file had been committed, in spite of having restored SAVED-DATABASE. Fixes <https://issues.guix.gnu.org/59784>. Reported by pelzflorian (Florian Pelz) <pelzflorian@pelzflorian.de>. * gnu/installer/final.scm (install-system): Before restarting guix-daemon, delete db.sqlite-{wal,shm}.
This commit is contained in:
parent
9b6703eabe
commit
495c50008b
1 changed files with 9 additions and 1 deletions
|
@ -221,10 +221,18 @@ (define (assert-exit x)
|
|||
;; alive.
|
||||
(stop-service 'guix-daemon)
|
||||
|
||||
;; Restore the database and restart it.
|
||||
;; Restore the database and restart it. As part of restoring the
|
||||
;; database, remove the WAL and shm files in case they were left
|
||||
;; behind after guix-daemon was stopped. Failing to do so,
|
||||
;; sqlite might behave as if transactions that appear in the WAL
|
||||
;; file were committed. (See <https://www.sqlite.org/wal.html>.)
|
||||
(installer-log-line "restoring store database from '~a'"
|
||||
saved-database)
|
||||
(copy-file saved-database database-file)
|
||||
(for-each (lambda (suffix)
|
||||
(false-if-exception
|
||||
(delete-file (string-append database-file suffix))))
|
||||
'("-wal" "-shm"))
|
||||
(start-service 'guix-daemon)
|
||||
|
||||
;; Finally umount the cow-store and exit the container.
|
||||
|
|
Loading…
Reference in a new issue