aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2023-04-20 16:42:08 +0100
committerChristopher Baines <mail@cbaines.net>2023-04-20 16:42:08 +0100
commitf2d9ded414fbd627a3b80d7b00ff9972909e0f7a (patch)
tree1ba35dfda814e7ee86302104828056f24116b661
parent1dfc122658d00d98dbd3a18ecda3502ce28cde41 (diff)
downloadbuild-coordinator-f2d9ded414fbd627a3b80d7b00ff9972909e0f7a.tar
build-coordinator-f2d9ded414fbd627a3b80d7b00ff9972909e0f7a.tar.gz
Look at the output from running the wal checkpoint
As I think it might be blocked sometimes.
-rw-r--r--guix-build-coordinator/datastore/sqlite.scm17
1 files changed, 16 insertions, 1 deletions
diff --git a/guix-build-coordinator/datastore/sqlite.scm b/guix-build-coordinator/datastore/sqlite.scm
index 34f8b09..465e874 100644
--- a/guix-build-coordinator/datastore/sqlite.scm
+++ b/guix-build-coordinator/datastore/sqlite.scm
@@ -238,7 +238,22 @@
metrics-registry
checkpoint-duration-metric-name
(lambda ()
- (sqlite-exec db "PRAGMA wal_checkpoint(TRUNCATE);"))))
+ (let ((statement
+ (sqlite-prepare
+ db
+ "PRAGMA wal_checkpoint(TRUNCATE);")))
+ (match (sqlite-step statement)
+ (#(blocked? modified-page-count pages-moved-to-db)
+ (if (= blocked? 1)
+ (simple-format
+ (current-error-port)
+ "warning: wal checkpoint blocked\n")
+ (simple-format
+ (current-error-port)
+ "wal checkpoint completed (~A, ~A)\n"
+ modified-page-count
+ pages-moved-to-db))))
+ (sqlite-finalize statement)))))
(call-with-duration-metric
metrics-registry