diff --git a/.github/workflows/go-releaser.yml b/.github/workflows/go-releaser.yml index 2e36d1d2ad..b3aedab010 100644 --- a/.github/workflows/go-releaser.yml +++ b/.github/workflows/go-releaser.yml @@ -86,3 +86,11 @@ jobs: for distro in ${RHEL_DISTROS}; do package_cloud push "${repo}/${distro}" dist/*.rpm done + + - name: Upload assets + uses: actions/upload-artifact@v3 + with: + name: release-assets + path: | + dist/*.deb + dist/*.rpm \ No newline at end of file diff --git a/pkg/pgmodel/ingestor/copier.go b/pkg/pgmodel/ingestor/copier.go index df3599d9d6..e6287462a2 100644 --- a/pkg/pgmodel/ingestor/copier.go +++ b/pkg/pgmodel/ingestor/copier.go @@ -205,14 +205,11 @@ func doInsertOrFallback(ctx context.Context, conn pgxconn.PgxConn, reqs ...copyR defer span.End() err, _ := insertSeries(ctx, conn, false, reqs...) if err != nil { - if isPGUniqueViolation(err) { - err, _ = insertSeries(ctx, conn, true, reqs...) - } - if err != nil { + if !isPGUniqueViolation(err) { log.Error("msg", err) - insertBatchErrorFallback(ctx, conn, reqs...) - return } + insertBatchErrorFallback(ctx, conn, reqs...) + return } for i := range reqs { @@ -350,6 +347,13 @@ func insertSeries(ctx context.Context, conn pgxconn.PgxConn, onConflict bool, re insertStart := time.Now() lowestEpoch := pgmodel.SeriesEpoch(math.MaxInt64) lowestMinTime := int64(math.MaxInt64) + + if onConflict && len(reqs) > 1 { + //holding on to long locks with ON CONFLICT considered harmful becase of mxid bloat + //no code path should use this. We leave this here to protect against this case in the future. + panic("should not try to insert to more than one metric per transaction with ON CONFLICT") + } + tx, err := conn.BeginTx(ctx) if err != nil { return fmt.Errorf("failed to start transaction for inserting metrics: %v", err), lowestMinTime