diff options
| author | Julie Qiu <julie@golang.org> | 2020-04-22 22:19:27 -0400 |
|---|---|---|
| committer | Julie Qiu <julieqiu@google.com> | 2020-04-23 16:16:47 +0000 |
| commit | 5599c558a14efd44b957ef0da0f49333c13bced5 (patch) | |
| tree | 38dda9bc579dc248809e7adeccb8b1df0e612060 /internal/postgres/versionstate.go | |
| parent | 2a8c3112a0f6e555272149117fe3d98ec9934a32 (diff) | |
| download | go-x-pkgsite-5599c558a14efd44b957ef0da0f49333c13bced5.tar.xz | |
internal/postgres: do not delete package version states
At the moment when we upsert a row into module_version_states, we
delete and repopulate existing rows in package_version_states.
This adds an additional query that is costly and isn't necessary, since
we wouldn't expect there to be packages missing in a future round of
processing. Also, if for some reason that did happen, it would be useful
to have this data captured in package_version_states anyways.
Change-Id: Iceb64235957ade115293bb7c1ff62cdcb2e2073f
Reviewed-on: https://team-review.git.corp.google.com/c/golang/discovery/+/725870
CI-Result: Cloud Build <devtools-proctor-result-processor@system.gserviceaccount.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Diffstat (limited to 'internal/postgres/versionstate.go')
| -rw-r--r-- | internal/postgres/versionstate.go | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/internal/postgres/versionstate.go b/internal/postgres/versionstate.go index ab16877d..48d7883b 100644 --- a/internal/postgres/versionstate.go +++ b/internal/postgres/versionstate.go @@ -99,11 +99,6 @@ func (db *DB) UpsertModuleVersionState(ctx context.Context, modulePath, vers, ap if affected != 1 { return fmt.Errorf("module version state update affected %d rows, expected exactly 1", affected) } - - if _, err := tx.Exec(ctx, `DELETE FROM package_version_states WHERE module_path=$1 AND version=$2`, modulePath, vers); err != nil { - return fmt.Errorf("failed to delete rows from package_version_states for %q@%q: %v", modulePath, vers, err) - } - if len(packageVersionStates) == 0 { return nil } |
