The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/6212

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
The above bug causes dqlite to crash when a read query issued during a big
transaction triggers a page cache spill. The value of 50M should be
enough for most users until we fix this in dqlite.

Signed-off-by: Free Ekanayaka <free.ekanay...@canonical.com>
From 689cca71b6245c5a7457375dbbe196cfbaadfb2e Mon Sep 17 00:00:00 2001
From: Free Ekanayaka <free.ekanay...@canonical.com>
Date: Mon, 16 Sep 2019 17:08:31 +0200
Subject: [PATCH] Band aid for https://github.com/canonical/dqlite/issues/163

The above bug causes dqlite to crash when a read query issued during a big
transaction triggers a page cache spill. The value of 50M should be
enough for most users until we fix this in dqlite.

Signed-off-by: Free Ekanayaka <free.ekanay...@canonical.com>
---
 lxd/db/db.go | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lxd/db/db.go b/lxd/db/db.go
index feec9af821..40fd7ad876 100644
--- a/lxd/db/db.go
+++ b/lxd/db/db.go
@@ -213,6 +213,12 @@ func OpenCluster(name string, store driver.NodeStore, 
address, dir string, timeo
                }
        }
 
+       // FIXME: https://github.com/canonical/dqlite/issues/163
+       _, err = db.Exec("PRAGMA cache_size=-50000")
+       if err != nil {
+               return nil, errors.Wrap(err, "Failed to set page cache size")
+       }
+
        if dump != nil {
                logger.Infof("Migrating data from local to global database")
                err := query.Transaction(db, func(tx *sql.Tx) error {
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to