Skip to content

Commit

Permalink
chore: applying 1.11.4 hotfixes to main branch (#3716)
Browse files Browse the repository at this point in the history
  • Loading branch information
atzoum committed Aug 8, 2023
1 parent de33fc3 commit 817e97f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [1.11.4](https://github.com/rudderlabs/rudder-server/compare/v1.11.3...v1.11.4) (2023-08-08)


### Bug Fixes

* **jobsdb:** when running in embedded mode migration fails with column workspace_id does not exist ([#3714](https://github.com/rudderlabs/rudder-server/issues/3714)) ([744cfd6](https://github.com/rudderlabs/rudder-server/commit/744cfd6f7dc6f3ebf1d28a71fd2582b5b0ca1355))

## [1.11.3](https://github.com/rudderlabs/rudder-server/compare/v1.11.2...v1.11.3) (2023-07-28)


Expand Down
24 changes: 12 additions & 12 deletions app/apphandlers/embeddedAppHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,18 @@ func (a *embeddedApp) StartRudderCore(ctx context.Context, options *app.Options)
return err
}

// This separate gateway db is created just to be used with gateway because in case of degraded mode,
// the earlier created gwDb (which was created to be used mainly with processor) will not be running, and it
// will cause issues for gateway because gateway is supposed to receive jobs even in degraded mode.
gatewayDB := jobsdb.NewForWrite(
"gw",
jobsdb.WithClearDB(options.ClearDB),
)
if err = gatewayDB.Start(); err != nil {
return fmt.Errorf("could not start gateway: %w", err)
}
defer gatewayDB.Stop()

// This gwDBForProcessor should only be used by processor as this is supposed to be stopped and started with the
// Processor.
gwDBForProcessor := jobsdb.NewForRead(
Expand Down Expand Up @@ -269,18 +281,6 @@ func (a *embeddedApp) StartRudderCore(ctx context.Context, options *app.Options)
return fmt.Errorf("failed to create gw rate limiter: %w", err)
}
gw := gateway.HandleT{}
// This separate gateway db is created just to be used with gateway because in case of degraded mode,
// the earlier created gwDb (which was created to be used mainly with processor) will not be running, and it
// will cause issues for gateway because gateway is supposed to receive jobs even in degraded mode.
gatewayDB := jobsdb.NewForWrite(
"gw",
jobsdb.WithClearDB(options.ClearDB),
)
if err = gatewayDB.Start(); err != nil {
return fmt.Errorf("could not start gateway: %w", err)
}
defer gatewayDB.Stop()

err = gw.Setup(
ctx,
a.app, backendconfig.DefaultBackendConfig, gatewayDB, errDBForWrite,
Expand Down

0 comments on commit 817e97f

Please sign in to comment.