all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jan Nieuwenhuizen <janneke@gnu.org>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 42151@debbugs.gnu.org
Subject: bug#42151: [PATCH 4/3] database: Do not use journal_model=WAL for the Hurd.
Date: Sat, 04 Jul 2020 10:12:47 +0200	[thread overview]
Message-ID: <87y2nzr94w.fsf_-_@gnu.org> (raw)
In-Reply-To: <87sge8wrdf.fsf@gnu.org> (Jan Nieuwenhuizen's message of "Fri, 03 Jul 2020 17:27:40 +0200")

[-- Attachment #1: Type: text/plain, Size: 1448 bytes --]

Jan Nieuwenhuizen writes:

Adding one additional patch to this series, hence 4/3 (see attached)
fixes the sqlite problem.

With this over-complete series we can now do offload builds to a
childhurd:

--8<---------------cut here---------------start------------->8---
$ guix build -e '(@@ (gnu packages commencement) rsync-boot0)'
sending 74 store items (365 MiB) to 'localhost'...
exporting path `/gnu/store/1kf05mhh31wl89r3mlx52x5sxrjivi7i-module-import-compiled-guile-builder'
exporting path `/gnu/store/7jxamp3g8wdr6vwrisqfmrncxh8nbfb4-mirrors'
[...]
exporting path `/gnu/store/x8wnf0h0ipibgzadlbmll8bcnhvv1yaq-diffutils-boot0-3.7'
offloading '/gnu/store/3xmmbjfqrl4p4sn8vljfdikypb0vi5am-rsync-3.1.3.drv' to 'localhost'...
offloading build of /gnu/store/3xmmbjfqrl4p4sn8vljfdikypb0vi5am-rsync-3.1.3.drv to 'localhost'
[...]
@ build-succeeded /gnu/store/3xmmbjfqrl4p4sn8vljfdikypb0vi5am-rsync-3.1.3.drv -
retrieving 1 store item from 'localhost'...
importing file or directory '/gnu/store/haf6mlm8xa6s2q918s05pijl6ql17mnq-rsync-3.1.3'...
guix offload: error: corrupt input while restoring archive from #<input: string 7ff4794cee00>
guix build: error: build of `/gnu/store/3xmmbjfqrl4p4sn8vljfdikypb0vi5am-rsync-3.1.3.drv' failed
[1]10:04:55 janneke@dundal:~/src/guix/master [env]
--8<---------------cut here---------------end--------------->8---

After the build succeeds, the download fails but lets first get this
patch series done...

Janneke


[-- Attachment #2: 0004-database-Do-not-use-journal_model-WAL-for-the-Hurd.patch --]
[-- Type: text/x-patch, Size: 2677 bytes --]

From dc6f96fc7de50602fb28d7ad7b8cbff09e55f538 Mon Sep 17 00:00:00 2001
From: "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org>
Date: Fri, 3 Jul 2020 23:45:20 +0200
Subject: [PATCH 4/3] database: Do not use journal_model=WAL for the Hurd.
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=UTF-8

This fixes <https://bugs.gnu.org/42151>.

* guix/store/database.scm (call-with-database): When building for the Hurd,
do not set journal_model=WAL.
---
 guix/store/database.scm | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/guix/store/database.scm b/guix/store/database.scm
index a38e4d7e52..da46b0abce 100644
--- a/guix/store/database.scm
+++ b/guix/store/database.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2017, 2019 Caleb Ristvedt <caleb.ristvedt@cune.org>
 ;;; Copyright © 2018, 2020 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -20,6 +21,7 @@
 (define-module (guix store database)
   #:use-module (sqlite3)
   #:use-module (guix config)
+  #:use-module (guix gexp)
   #:use-module (guix serialization)
   #:use-module (guix store deduplication)
   #:use-module (guix base16)
@@ -27,6 +29,7 @@
   #:use-module (guix build syscalls)
   #:use-module ((guix build utils)
                 #:select (mkdir-p executable-file?))
+  #:use-module (guix utils)
   #:use-module (guix build store-copy)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-11)
@@ -105,9 +108,12 @@ create it and initialize it as a new database."
                      (mkdir-p (dirname file))
                      #t)))
         (db   (sqlite-open file)))
-    ;; Turn DB in "write-ahead log" mode, which should avoid SQLITE_LOCKED
-    ;; errors when we have several readers: <https://www.sqlite.org/wal.html>.
-    (sqlite-exec db "PRAGMA journal_mode=WAL;")
+    ;; Using WAL breaks for the Hurd <https://bugs.gnu.org/42151>.
+    (unless (let-system (system target)
+              (equal? target "i586-pc-gnu"))
+      ;; Turn DB in "write-ahead log" mode, which should avoid SQLITE_LOCKED
+      ;; errors when we have several readers: <https://www.sqlite.org/wal.html>.
+      (sqlite-exec db "PRAGMA journal_mode=WAL;"))
 
     ;; Install a busy handler such that, when the database is locked, sqlite
     ;; retries until 30 seconds have passed, at which point it gives up and
-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com


[-- Attachment #3: Type: text/plain, Size: 152 bytes --]


-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com

  reply	other threads:[~2020-07-04  8:14 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-01 14:29 bug#42151: [PATCH 0/3] offload to Childhurd fails: setting synchronous mode: locking protocol Jan (janneke) Nieuwenhuizen
2020-07-01 14:31 ` bug#42151: [PATCH 1/3] gnu: Add sqlite/hurd with locking fix Jan (janneke) Nieuwenhuizen
2020-07-01 14:31   ` bug#42151: [PATCH 2/3] gnu: guile-sqlite3: Use sqlite/hurd for locking on the Hurd Jan (janneke) Nieuwenhuizen
2020-07-10 12:06     ` Ludovic Courtès
2020-07-10 18:34       ` Jan Nieuwenhuizen
2020-07-01 14:31   ` bug#42151: [PATCH 3/3] gnu: guix: " Jan (janneke) Nieuwenhuizen
2020-07-10 12:07     ` Ludovic Courtès
2020-07-10 16:25       ` Jan Nieuwenhuizen
2020-07-10 12:05   ` bug#42151: [PATCH 1/3] gnu: Add sqlite/hurd with locking fix Ludovic Courtès
2020-07-10 18:34     ` Jan Nieuwenhuizen
2020-07-01 17:01 ` bug#42151: [PATCH 0/3] offload to Childhurd fails: setting synchronous mode: locking protocol Jan Nieuwenhuizen
2020-07-02 12:49 ` Ludovic Courtès
2020-07-03 10:03   ` Jan Nieuwenhuizen
2020-07-03 13:51     ` Ludovic Courtès
2020-07-03 15:27       ` Jan Nieuwenhuizen
2020-07-04  8:12         ` Jan Nieuwenhuizen [this message]
2020-07-07  5:04           ` bug#42151: [PATCH 4/3] database: Do not use journal_model=WAL for the Hurd Jan Nieuwenhuizen
2020-07-10 12:03           ` Ludovic Courtès
2020-07-10 15:40             ` Jan Nieuwenhuizen
2020-07-10 12:34         ` bug#42151: [PATCH 0/3] offload to Childhurd fails: setting synchronous mode: locking protocol Ludovic Courtès
2020-07-10 15:42 ` bug#42151: [PATCH v2 1/4] gnu: Add sqlite/hurd with locking fix Jan (janneke) Nieuwenhuizen
2020-07-10 15:42   ` bug#42151: [PATCH v2 2/4] gnu: guile-sqlite3: Use sqlite/hurd for locking on the Hurd Jan (janneke) Nieuwenhuizen
2020-07-10 15:42   ` bug#42151: [PATCH v2 3/4] gnu: guix: " Jan (janneke) Nieuwenhuizen
2020-07-10 15:42   ` bug#42151: [PATCH v2 4/4] image: Do not set journal_model=WAL for " Jan (janneke) Nieuwenhuizen
2020-07-10 18:35 ` bug#42151: [PATCH v3 1/2] gnu: sqlite: Add locking-mode fix " Jan (janneke) Nieuwenhuizen
2020-07-10 18:35   ` bug#42151: [PATCH v3 2/2] image: Do not set journal_model=WAL " Jan (janneke) Nieuwenhuizen
2020-07-11 14:22     ` Ludovic Courtès
2020-07-11 14:36       ` Jan Nieuwenhuizen
2020-07-11 14:18   ` bug#42151: [PATCH v3 1/2] gnu: sqlite: Add locking-mode fix " Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y2nzr94w.fsf_-_@gnu.org \
    --to=janneke@gnu.org \
    --cc=42151@debbugs.gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.