diff options
author | Christopher Baines <mail@cbaines.net> | 2023-04-20 16:42:08 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2023-04-20 16:42:08 +0100 |
commit | f2d9ded414fbd627a3b80d7b00ff9972909e0f7a (patch) | |
tree | 1ba35dfda814e7ee86302104828056f24116b661 | |
parent | 1dfc122658d00d98dbd3a18ecda3502ce28cde41 (diff) | |
download | build-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.scm | 17 |
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 |