Skip to content

Commit

Permalink
Merge branch 'master' into sync-release-abd2cdba2fb4e2b5e5f779540dff3…
Browse files Browse the repository at this point in the history
…8cbeab899e1
  • Loading branch information
mihir20 authored Dec 20, 2024
2 parents 17b2956 + 98827e5 commit ed7eab0
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 15 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,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)


Expand Down
15 changes: 9 additions & 6 deletions enterprise/reporting/error_reporting.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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() {
Expand Down
6 changes: 0 additions & 6 deletions enterprise/reporting/flusher/flusher.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
8 changes: 5 additions & 3 deletions enterprise/reporting/reporting.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit ed7eab0

Please sign in to comment.