From 0300ad58a97098674ca4757c79a74a05e9c33322 Mon Sep 17 00:00:00 2001 From: Oleg Zaytsev Date: Tue, 30 Jul 2024 11:31:31 +0200 Subject: [PATCH] Revert the option regardless of error Signed-off-by: Oleg Zaytsev --- tsdb/head.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tsdb/head.go b/tsdb/head.go index 1659e57a4..9d81b24ae 100644 --- a/tsdb/head.go +++ b/tsdb/head.go @@ -630,8 +630,8 @@ func (h *Head) Init(minValidTime int64) (err error) { if h.opts.EnableSharding { h.opts.EnableSharding = false defer func() { + h.opts.EnableSharding = true if err == nil { - h.opts.EnableSharding = true // No locking is needed here as nobody should be writing while we're in Init. for _, stripe := range h.series.series { for _, s := range stripe {