From ed260cfa671d71e73ce28b634f7c8ae8bfdb0f04 Mon Sep 17 00:00:00 2001 From: Jonathan Amsterdam Date: Thu, 3 Jun 2021 06:56:19 -0400 Subject: internal/postgres: add experiment to disable symbol insertion Inserting symbols is causing errors because the generated sequence values overflow the integer type. Add an experiment that will let us turn off writing to the symbols tables until we can change the type. Change-Id: Ied3484a8db07df0f0795ff28de96760a3595ee67 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/324631 Trust: Jonathan Amsterdam Run-TryBot: Jonathan Amsterdam TryBot-Result: kokoro Reviewed-by: Jamal Carvalho --- internal/postgres/insert_module.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'internal/postgres/insert_module.go') diff --git a/internal/postgres/insert_module.go b/internal/postgres/insert_module.go index 7d51457c..cdedc975 100644 --- a/internal/postgres/insert_module.go +++ b/internal/postgres/insert_module.go @@ -23,6 +23,7 @@ import ( "golang.org/x/pkgsite/internal" "golang.org/x/pkgsite/internal/database" "golang.org/x/pkgsite/internal/derrors" + "golang.org/x/pkgsite/internal/experiment" "golang.org/x/pkgsite/internal/licenses" "golang.org/x/pkgsite/internal/log" "golang.org/x/pkgsite/internal/stdlib" @@ -422,6 +423,11 @@ func (pdb *DB) insertUnits(ctx context.Context, tx *database.DB, m *internal.Mod if err != nil { return err } + + if experiment.IsActive(ctx, internal.ExperimentSkipInsertSymbols) { + return nil + } + if versionType == version.TypeRelease { // Lock the module path here to prevent conflicts in upsertSymbolHistory. // The lock function will also be called after this, in saveModule, but -- cgit v1.3-5-g9baa