feat: add feature flag to clickhouse migration #6444
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
The issue was that ClickHouse migrations were starting automatically when the server launched. To address this, I implemented a flag feature for conditional migrations. An environment variable,
CLICKHOUSE_MIGRATION_ENABLED
, was introduced with a default value offalse
. When set tofalse
, migrations do not run; if changed totrue
, migrations will execute. This allows for an optimized, dynamic approach to managing migrations.Related Issues / PR's
resolves #5678
Screenshots
NA
Affected Areas and Manually Tested Areas
Important
Adds a feature flag to conditionally execute ClickHouse migrations based on an environment variable.
CLICKHOUSE_MIGRATION_ENABLED
environment variable to control ClickHouse migrations.false
(default), migrations are skipped; iftrue
, migrations are executed.IsClickhouseMigrationEnable()
inconstants.go
to check the environment variable.ClickHouseMigrate()
inmigrate.go
to accept aconfig
parameter and conditionally execute migrations.NewServer()
inserver.go
in bothee/query-service/app
andpkg/query-service/app
to use the new feature flag for migrations.This description was created by for aae2372. It will automatically update as commits are pushed.