aboutsummaryrefslogtreecommitdiff
path: root/internal/postgres/insert_module.go
diff options
context:
space:
mode:
authorJonathan Amsterdam <jba@google.com>2021-06-03 06:56:19 -0400
committerJonathan Amsterdam <jba@google.com>2021-06-03 14:07:50 +0000
commited260cfa671d71e73ce28b634f7c8ae8bfdb0f04 (patch)
treef438d764b656ad132a4954d6fcdc3c7c75b4f2a8 /internal/postgres/insert_module.go
parentec663bae090d204c148feae21f9a670996877321 (diff)
downloadgo-x-pkgsite-ed260cfa671d71e73ce28b634f7c8ae8bfdb0f04.tar.xz
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 <jba@google.com> Run-TryBot: Jonathan Amsterdam <jba@google.com> TryBot-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Jamal Carvalho <jamal@golang.org>
Diffstat (limited to 'internal/postgres/insert_module.go')
-rw-r--r--internal/postgres/insert_module.go6
1 files changed, 6 insertions, 0 deletions
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