[lxc-devel] [lxd/master] Reduce the frequency of raft snapshots

freeekanayaka on Github lxc-bot at linuxcontainers.org
Wed Jul 11 14:14:24 UTC 2018


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 763 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20180711/2b371249/attachment.bin>
-------------- next part --------------
From 02689d2c19563893bc10904d7026b18281f1f02c Mon Sep 17 00:00:00 2001
From: Free Ekanayaka <free.ekanayaka at canonical.com>
Date: Wed, 11 Jul 2018 14:10:08 +0000
Subject: [PATCH] Reduce the frequency of raft snapshots

We have been taking raft snapshots agressively for a while now, to mitigate

This change makes the frequency less aggressive. It shouldn't really make a
difference regarding #4485, since we take a raft snapshot at daemon shutdown
anyways, so the net effect is virtually the same (except in case of hard
crashes).

The snapshots trick will go away altogether in the new dqlite implementation.

Signed-off-by: Free Ekanayaka <free.ekanayaka at canonical.com>
---
 lxd/cluster/raft.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lxd/cluster/raft.go b/lxd/cluster/raft.go
index b40493a20..742fa26fd 100644
--- a/lxd/cluster/raft.go
+++ b/lxd/cluster/raft.go
@@ -406,7 +406,7 @@ func raftConfig(latency float64) *raft.Config {
 	//             number of uncompacted raft logs low, and workaround slow
 	//             log replay when the LXD daemon starts (see #4485). A more
 	//             proper fix should be probably implemented in dqlite.
-	config.SnapshotThreshold = 64
+	config.SnapshotThreshold = 512
 	config.TrailingLogs = 128
 
 	return config


More information about the lxc-devel mailing list