diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e1c8633ff..5822b2ae34 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -82,6 +82,18 @@ * upgrade major version pglock ([#5292](https://github.com/rudderlabs/rudder-server/issues/5292)) ([1f575ec](https://github.com/rudderlabs/rudder-server/commit/1f575ec2b5eac32df856ccf2d55ee2d40a516d8e)) * webhook integration tests commandline ([#5286](https://github.com/rudderlabs/rudder-server/issues/5286)) ([1d3ac29](https://github.com/rudderlabs/rudder-server/commit/1d3ac296789c2c65753df4f65ff80d971f4c3a0b)) +## [1.38.4](https://github.com/rudderlabs/rudder-server/compare/v1.38.3...v1.38.4) (2024-12-04) + + +### Bug Fixes + +* disable vacuum at startup for reporting ([#5325](https://github.com/rudderlabs/rudder-server/issues/5325)) ([d8fb8be](https://github.com/rudderlabs/rudder-server/commit/d8fb8be7a5ace45b6198579283b4f3b77cf71fbd)) + + +### Miscellaneous + +* remove full vacuum at flusher startup ([#5332](https://github.com/rudderlabs/rudder-server/issues/5332)) ([65ab23c](https://github.com/rudderlabs/rudder-server/commit/65ab23c79933d880dfef3dd8ff6e4a150f26435d)) + ## [1.38.3](https://github.com/rudderlabs/rudder-server/compare/v1.38.2...v1.38.3) (2024-11-20) diff --git a/enterprise/reporting/error_reporting.go b/enterprise/reporting/error_reporting.go index ea2a0d5647..28f7e3743c 100644 --- a/enterprise/reporting/error_reporting.go +++ b/enterprise/reporting/error_reporting.go @@ -28,6 +28,7 @@ import ( "github.com/rudderlabs/rudder-go-kit/stats/collectors" obskit "github.com/rudderlabs/rudder-observability-kit/go/labels" + migrator "github.com/rudderlabs/rudder-server/services/sql-migrator" "github.com/rudderlabs/rudder-server/utils/httputil" . "github.com/rudderlabs/rudder-server/utils/tx" //nolint:staticcheck @@ -160,12 +161,14 @@ func (edr *ErrorDetailReporter) DatabaseSyncer(c types.SyncerConfig) types.Repor if !edr.config.GetBool("Reporting.errorReporting.syncer.enabled", true) { return func() {} } - if _, err := dbHandle.ExecContext( - context.Background(), - fmt.Sprintf("vacuum full analyze %s", pq.QuoteIdentifier(ErrorDetailReportsTable)), - ); err != nil { - edr.log.Errorn("error full vacuuming", logger.NewStringField("table", ErrorDetailReportsTable), obskit.Error(err)) - panic(err) + if edr.config.GetBool("Reporting.errorReporting.vacuumAtStartup", false) { + if _, err := dbHandle.ExecContext( + context.Background(), + fmt.Sprintf("vacuum full analyze %s", pq.QuoteIdentifier(ErrorDetailReportsTable)), + ); err != nil { + edr.log.Errorn("error full vacuuming", logger.NewStringField("table", ErrorDetailReportsTable), obskit.Error(err)) + panic(err) + } } return func() { diff --git a/enterprise/reporting/flusher/flusher.go b/enterprise/reporting/flusher/flusher.go index d18f9afe34..d4b333677a 100644 --- a/enterprise/reporting/flusher/flusher.go +++ b/enterprise/reporting/flusher/flusher.go @@ -117,12 +117,6 @@ func NewFlusher(db *sql.DB, log logger.Logger, stats stats.Stats, conf *config.C f.initCommonTags() f.initStats(f.commonTags) - if _, err := db.Exec( - fmt.Sprintf("vacuum full analyze %s", pq.QuoteIdentifier(table)), - ); err != nil { - log.Errorn("error full vacuuming", logger.NewStringField("table", table), obskit.Error(err)) - return nil, fmt.Errorf("error full vacuuming %s table %w", table, err) - } return &f, nil } diff --git a/enterprise/reporting/reporting.go b/enterprise/reporting/reporting.go index 3d2b281a80..8fddbec0fe 100644 --- a/enterprise/reporting/reporting.go +++ b/enterprise/reporting/reporting.go @@ -185,9 +185,11 @@ func (r *DefaultReporter) DatabaseSyncer(c types.SyncerConfig) types.ReportingSy if !config.GetBool("Reporting.syncer.enabled", true) { return func() {} } - if _, err := dbHandle.ExecContext(context.Background(), `vacuum full analyze reports;`); err != nil { - r.log.Errorn(`[ Reporting ]: Error full vacuuming reports table`, logger.NewErrorField(err)) - panic(err) + if config.GetBool("Reporting.syncer.vacuumAtStartup", false) { + if _, err := dbHandle.ExecContext(context.Background(), `vacuum full analyze reports;`); err != nil { + r.log.Errorn(`[ Reporting ]: Error full vacuuming reports table`, logger.NewErrorField(err)) + panic(err) + } } return func() { r.g.Go(func() error {