From 50e7f9f697736e94dc6a65e8f2ccd6dd51638862 Mon Sep 17 00:00:00 2001 From: Benjamin Wang Date: Thu, 12 Dec 2024 14:49:14 +0000 Subject: [PATCH] Add a TODO comment for UnsafeDetectSchemaVersion on how to simplify the implementation Signed-off-by: Benjamin Wang --- server/storage/schema/schema.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/storage/schema/schema.go b/server/storage/schema/schema.go index 0f54c04fabe..b87b73cc831 100644 --- a/server/storage/schema/schema.go +++ b/server/storage/schema/schema.go @@ -95,6 +95,12 @@ func UnsafeDetectSchemaVersion(lg *zap.Logger, tx backend.UnsafeReader) (v semve if vp != nil { return *vp, nil } + + // TODO: remove the operations of reading the fields `confState` + // and `term` in 3.7. We only need to be back-compatible + // with 3.6 when we are running 3.7, and the `storageVersion` + // already exists in all versions >= 3.6, so we don't need to + // use any other fields to identify the etcd's storage version. confstate := UnsafeConfStateFromBackend(lg, tx) if confstate == nil { return v, fmt.Errorf("missing confstate information")