Skip to content

feat: Adds gzip compression level configuration to backups for v2#574

Open
devanbenz wants to merge 7 commits intomainfrom
db/v2-backup-perf
Open

feat: Adds gzip compression level configuration to backups for v2#574
devanbenz wants to merge 7 commits intomainfrom
db/v2-backup-perf

Conversation

@devanbenz
Copy link
Contributor

No description provided.

@devanbenz devanbenz requested a review from Copilot March 24, 2026 21:50
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for configuring server-side gzip compression level when downloading backup snapshots (v2), wiring a new CLI flag through the backup client and OpenAPI-generated client.

Changes:

  • Add --gzip-compression-level CLI flag and plumb it into backup request parameters.
  • Send Gzip-Compression-Level header on backup metadata and shard download requests when configured.
  • Update OpenAPI contract and regenerated models/clients (including InfluxQL response/model updates).

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
cmd/influx/backup.go Adds CLI flag to configure server-side gzip compression level.
clients/backup/backup.go Passes configured gzip compression level into API requests.
api/contract/overrides/paths/backup_metadata.yml Documents the new request header in the OpenAPI overrides.
api/api_backup.gen.go Adds generated request field + header plumbing for Gzip-Compression-Level.
api/model_script_language.gen.go Adds influxql as a supported ScriptLanguage value.
api/model_influxql_json_response*.gen.go Improves InfluxQL response model docs and adds partial to results.
api/contract/openapi Bumps OpenAPI submodule pointer for regenerated output.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

// An array of series objects--the results of the query. A series of rows shares the same group key returned from the execution of a statement. If a property is not present, it is assumed to be `null`.
Series *[]InfluxqlJsonResponseSeries `json:"series,omitempty" yaml:"series,omitempty"`
// True if the resultset is not complete--the response data is chunked; otherwise, false or omitted.
Partial *bool `json:"partial,omitempty" yaml:"partial,omitempty"`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Analysis of change here:

The main consumer is the v1 shell client (clients/v1_shell/v1_shell.go). It calls the legacy /query endpoint, deserializes the JSON into api.InfluxqlJsonResponse via json.Unmarshal(), then renders results. The schema change adds descriptions and a Partial boolean field, since json.Unmarshal ignores unknown/missing fields by default, existing code won't break from the addition.

@devanbenz devanbenz self-assigned this Mar 25, 2026
Copy link
Contributor

@davidby-influx davidby-influx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but @gwossum should review as well.

@davidby-influx davidby-influx requested a review from gwossum March 25, 2026 20:25
@gwossum
Copy link
Member

gwossum commented Mar 26, 2026

@devanbenz This doesn't seem to work. I ran this branch of influx-cli against the influxdb db/2.x-oss-backup-perf branch. I expected to get an error when I specified --gzip-compression-level asdf, but I did not.

I captured the HTTP headers from influx-cli and saw:

Gzip-Compression-Level: asdf

It looks like influxdb is looking for a different header (gzip_compression_level):
https://github.com/influxdata/influxdb/blob/5efa0f051d784d35f5c0f165be65e7b6960a2799/http/backup_service.go#L100

@gwossum
Copy link
Member

gwossum commented Mar 26, 2026

@devanbenz In 1.x, it looks like the TSM file compression is done on the backup client side, but in 2.x the TSM file compression is done on the server side. Is that correct?

Assuming that's true, one thing to note is that the 2.x influx-cli currently passes along any compression level without checking if it's valid, then relies on the server to generate the error about an invalid compression level. Overall, I don't think that's a bad thing. Iif we add a new compression level you could use an outdated client and still take advantage of new compression levels on the server.

@devanbenz
Copy link
Contributor Author

@devanbenz This doesn't seem to work. I ran this branch of influx-cli against the influxdb db/2.x-oss-backup-perf branch. I expected to get an error when I specified --gzip-compression-level asdf, but I did not.

I captured the HTTP headers from influx-cli and saw:

Gzip-Compression-Level: asdf

It looks like influxdb is looking for a different header (gzip_compression_level): influxdata/influxdb@5efa0f0/http/backup_service.go#L100

Sorry, it is very possible you need to be testing against my latest changes to influxdb: influxdata/influxdb#27297 which are not yet ready.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants