Skip to content

DNM: Add page compression with zstd#373

Open
tjungblu wants to merge 1 commit intoopenshift:mainfrom
tjungblu:bboltzstd
Open

DNM: Add page compression with zstd#373
tjungblu wants to merge 1 commit intoopenshift:mainfrom
tjungblu:bboltzstd

Conversation

@tjungblu
Copy link
Copy Markdown

@tjungblu tjungblu commented Apr 27, 2026

This enables the bbolt compression raised upstream in etcd-io/bbolt#1159

Do not merge, this is only for testing purposes.
/hold

Please read https://github.com/etcd-io/etcd/blob/main/CONTRIBUTING.md#contribution-flow.

Summary by CodeRabbit

  • New Features

    • Enabled compression during database defragmentation
  • Chores

    • Updated indirect dependencies to newer releases
    • Added a module replacement to redirect a database dependency to an alternative implementation

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 27, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 27, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 722d2f75-db22-4ff8-aea2-c8c4893c1e3c

📥 Commits

Reviewing files that changed from the base of the PR and between 05a6f0f and b9ed1d4.

⛔ Files ignored due to path filters (4)
  • etcdutl/go.sum is excluded by !**/*.sum
  • go.sum is excluded by !**/*.sum
  • server/go.sum is excluded by !**/*.sum
  • tests/go.sum is excluded by !**/*.sum
📒 Files selected for processing (5)
  • etcdutl/go.mod
  • go.mod
  • server/go.mod
  • server/storage/backend/backend.go
  • tests/go.mod
✅ Files skipped from review due to trivial changes (1)
  • server/storage/backend/backend.go
🚧 Files skipped from review as they are similar to previous changes (2)
  • server/go.mod
  • go.mod

Walkthrough

The PR updates Go module dependencies in multiple go.mod files (bumping github.com/klauspost/compress to v1.18.4 and adding a replace redirect for go.etcd.io/bboltgithub.com/tjungblu/bbolt) and enables compression on the temporary BoltDB used during defragmentation.

Changes

Cohort / File(s) Summary
Module dependency updates
etcdutl/go.mod, go.mod, server/go.mod, tests/go.mod
Bump indirect module github.com/klauspost/compress from v1.17.9v1.18.4; add replace directive redirecting go.etcd.io/bbolt to github.com/tjungblu/bbolt@v0.0.0-... across module files.
Backend defragmentation change
server/storage/backend/backend.go
When creating the temporary BoltDB during defrag(), set options.Mlock = false and explicitly enable options.Compression = true.

Sequence Diagram(s)

(omitted — changes do not introduce multi-component sequential control flow requiring a diagram)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 12
✅ Passed checks (12 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'DNM: Add page compression with zstd' accurately describes the main change: introducing bbolt page compression using zstd, which aligns with the file modifications across go.mod dependency updates and backend.go compression enablement.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed PR modifies only go.mod files and backend.go compression logic, with no Ginkgo test files added or modified.
Test Structure And Quality ✅ Passed PR contains no Ginkgo test code changes, only dependency and backend.go modifications.
Microshift Test Compatibility ✅ Passed The custom check flags new Ginkgo e2e tests using MicroShift-incompatible APIs. This PR contains no new Ginkgo e2e tests, only go.mod updates and a compression enablement change in backend.go.
Single Node Openshift (Sno) Test Compatibility ✅ Passed No new Ginkgo e2e tests found; only go.mod updates and BoltDB compression configuration change.
Topology-Aware Scheduling Compatibility ✅ Passed PR contains only Go module dependency updates and an internal storage optimization enabling compression during defragmentation. No Kubernetes scheduling constraints, deployment manifests, or topology-related changes detected.
Ote Binary Stdout Contract ✅ Passed PR introduces no stdout contract violations; changes consist of go.mod updates and a single internal compression configuration line in defrag() function.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed This PR does not add any new Ginkgo e2e tests. Changes consist of dependency updates and backend configuration modifications only.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci openshift-ci Bot requested review from Elbehery and dusk125 April 27, 2026 13:27
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Apr 27, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tjungblu

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 27, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
server/storage/backend/backend.go (1)

504-506: Compression enabled on temporary database during defragmentation.

The implementation correctly applies compression only to the temporary database created during defragmentation:

  1. options.Mlock = false ensures the temp database isn't locked in memory (line 504)
  2. options.Compression = true enables zstd compression (lines 505-506)

The existing test at server/storage/backend/backend_test.go:160-196 validates that defragmentation preserves hash integrity and reduces file size, which will also verify compression works correctly.

For future production readiness, consider making compression configurable via BackendConfig rather than hardcoding it.

🔄 Optional refactor: Make compression configurable

For future production readiness, consider adding a configuration option:

// In BackendConfig, add:
// Compression enables zstd compression for the backend database.
// When enabled, pages are compressed using zstd algorithm.
Compression bool

// In defrag(), use the config:
options.Compression = bcfg.Compression

This would allow compression to be enabled/disabled based on user requirements and provide backward compatibility options.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@server/storage/backend/backend.go` around lines 504 - 506, The temp database
used during defragmentation currently hardcodes options.Compression = true;
update BackendConfig to include a Compression bool (e.g., add Compression field
to BackendConfig) and modify defrag() to set options.Compression =
bcfg.Compression (or the appropriate BackendConfig instance) instead of
hardcoding true so compression can be toggled per backend; ensure any tests that
expect compression behavior are updated or left unchanged by default config.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@server/storage/backend/backend.go`:
- Around line 504-506: The temp database used during defragmentation currently
hardcodes options.Compression = true; update BackendConfig to include a
Compression bool (e.g., add Compression field to BackendConfig) and modify
defrag() to set options.Compression = bcfg.Compression (or the appropriate
BackendConfig instance) instead of hardcoding true so compression can be toggled
per backend; ensure any tests that expect compression behavior are updated or
left unchanged by default config.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 1f00ba72-e319-4fc7-a8f6-837d8498f7d1

📥 Commits

Reviewing files that changed from the base of the PR and between 7fff975 and 05a6f0f.

⛔ Files ignored due to path filters (4)
  • etcdutl/go.sum is excluded by !**/*.sum
  • go.sum is excluded by !**/*.sum
  • server/go.sum is excluded by !**/*.sum
  • tests/go.sum is excluded by !**/*.sum
📒 Files selected for processing (5)
  • etcdutl/go.mod
  • go.mod
  • server/go.mod
  • server/storage/backend/backend.go
  • tests/go.mod

@tjungblu
Copy link
Copy Markdown
Author

/payload 5.0 nightly blocking

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Apr 27, 2026

@tjungblu: trigger 13 job(s) of type blocking for the nightly release of OCP 5.0

  • periodic-ci-openshift-release-main-ci-5.0-e2e-aws-upgrade-ovn-single-node
  • periodic-ci-openshift-release-main-nightly-5.0-e2e-aws-ovn-upgrade-fips
  • periodic-ci-openshift-release-main-ci-5.0-e2e-azure-ovn-upgrade
  • periodic-ci-openshift-release-main-ci-5.0-upgrade-from-stable-4.22-e2e-gcp-ovn-rt-upgrade
  • periodic-ci-openshift-hypershift-release-5.0-periodics-e2e-aws-ovn-conformance
  • periodic-ci-openshift-release-main-nightly-5.0-e2e-aws-ovn-serial-1of2
  • periodic-ci-openshift-release-main-nightly-5.0-e2e-aws-ovn-serial-2of2
  • periodic-ci-openshift-release-main-ci-5.0-e2e-aws-ovn-techpreview
  • periodic-ci-openshift-release-main-ci-5.0-e2e-aws-ovn-techpreview-serial-1of3
  • periodic-ci-openshift-release-main-ci-5.0-e2e-aws-ovn-techpreview-serial-2of3
  • periodic-ci-openshift-release-main-ci-5.0-e2e-aws-ovn-techpreview-serial-3of3
  • periodic-ci-openshift-release-main-nightly-5.0-e2e-metal-ipi-ovn-ipv4
  • periodic-ci-openshift-release-main-nightly-5.0-e2e-metal-ipi-ovn-ipv6

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/059f2b10-4245-11f1-8a9c-3abd1d77f7fd-0

This enables the bbolt compression raised upstream in etcd-io/bbolt#1159

Do not merge, this is only for testing purposes.
/hold

Signed-off-by: Thomas Jungblut <tjungblu@redhat.com>
@tjungblu
Copy link
Copy Markdown
Author

/payload 5.0 nightly blocking

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Apr 27, 2026

@tjungblu: trigger 13 job(s) of type blocking for the nightly release of OCP 5.0

  • periodic-ci-openshift-release-main-ci-5.0-e2e-aws-upgrade-ovn-single-node
  • periodic-ci-openshift-release-main-nightly-5.0-e2e-aws-ovn-upgrade-fips
  • periodic-ci-openshift-release-main-ci-5.0-e2e-azure-ovn-upgrade
  • periodic-ci-openshift-release-main-ci-5.0-upgrade-from-stable-4.22-e2e-gcp-ovn-rt-upgrade
  • periodic-ci-openshift-hypershift-release-5.0-periodics-e2e-aws-ovn-conformance
  • periodic-ci-openshift-release-main-nightly-5.0-e2e-aws-ovn-serial-1of2
  • periodic-ci-openshift-release-main-nightly-5.0-e2e-aws-ovn-serial-2of2
  • periodic-ci-openshift-release-main-ci-5.0-e2e-aws-ovn-techpreview
  • periodic-ci-openshift-release-main-ci-5.0-e2e-aws-ovn-techpreview-serial-1of3
  • periodic-ci-openshift-release-main-ci-5.0-e2e-aws-ovn-techpreview-serial-2of3
  • periodic-ci-openshift-release-main-ci-5.0-e2e-aws-ovn-techpreview-serial-3of3
  • periodic-ci-openshift-release-main-nightly-5.0-e2e-metal-ipi-ovn-ipv4
  • periodic-ci-openshift-release-main-nightly-5.0-e2e-metal-ipi-ovn-ipv6

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/918c1750-4245-11f1-9783-322de2dd3922-0

@tjungblu
Copy link
Copy Markdown
Author

/payload 5.0 nightly blocking

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Apr 28, 2026

@tjungblu: trigger 13 job(s) of type blocking for the nightly release of OCP 5.0

  • periodic-ci-openshift-release-main-ci-5.0-e2e-aws-upgrade-ovn-single-node
  • periodic-ci-openshift-release-main-nightly-5.0-e2e-aws-ovn-upgrade-fips
  • periodic-ci-openshift-release-main-ci-5.0-e2e-azure-ovn-upgrade
  • periodic-ci-openshift-release-main-ci-5.0-upgrade-from-stable-4.22-e2e-gcp-ovn-rt-upgrade
  • periodic-ci-openshift-hypershift-release-5.0-periodics-e2e-aws-ovn-conformance
  • periodic-ci-openshift-release-main-nightly-5.0-e2e-aws-ovn-serial-1of2
  • periodic-ci-openshift-release-main-nightly-5.0-e2e-aws-ovn-serial-2of2
  • periodic-ci-openshift-release-main-ci-5.0-e2e-aws-ovn-techpreview
  • periodic-ci-openshift-release-main-ci-5.0-e2e-aws-ovn-techpreview-serial-1of3
  • periodic-ci-openshift-release-main-ci-5.0-e2e-aws-ovn-techpreview-serial-2of3
  • periodic-ci-openshift-release-main-ci-5.0-e2e-aws-ovn-techpreview-serial-3of3
  • periodic-ci-openshift-release-main-nightly-5.0-e2e-metal-ipi-ovn-ipv4
  • periodic-ci-openshift-release-main-nightly-5.0-e2e-metal-ipi-ovn-ipv6

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/f06a1c40-42d1-11f1-801e-aff86dbe7c00-0

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

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant