Skip to content

DOWNSTREAM: carry: OCPBUGS-103516: Replace bbolt with patched fork to remove MADV_RANDOM - #395

Open
hasbro17 wants to merge 1 commit into
openshift:mainfrom
hasbro17:remove-madv-random
Open

DOWNSTREAM: carry: OCPBUGS-103516: Replace bbolt with patched fork to remove MADV_RANDOM#395
hasbro17 wants to merge 1 commit into
openshift:mainfrom
hasbro17:remove-madv-random

Conversation

@hasbro17

@hasbro17 hasbro17 commented Aug 4, 2026

Copy link
Copy Markdown

Summary

Testing-only PR — the actual downstream fix should land via openshift/bbolt once that fork is synced to upstream v1.4.3.

This replaces the bbolt dependency with a patched fork hasbro17/bbolt@remove-madv-random that removes the madvise(MADV_RANDOM) call from bbolt's mmap path.

Since Linux 6.4 (torvalds/linux@8788f678), MADV_RANDOM causes the kernel to aggressively evict mmap'd pages by
short-circuiting the second-chance LRU mechanism. This results in high major page fault rates on bbolt's database file, particularly during compaction which sees order-of-magnitude duration increases. On OCP
5.0 FIPS clusters (RHCOS10, kernel 6.12), this manifests as a ~30% WAL fdatasync P99 latency regression.

This is the same root cause as OCPBUGS-50521 (OCP 4.19), which was fixed kernel-side by reverting the behavior change in RHEL 9.6. The RHEL kernel team has stated this behavior will not be reverted in RHEL 10,
so the fix must be in bbolt.

Next steps

  • Validate with perfscale CI on RHCOS10 FIPS clusters
  • Sync openshift/bbolt to upstream v1.4.3 and apply the patch there
  • Update this PR's replace directive to point to openshift/bbolt (or open a new PR)
  • Push the fix upstream to etcd-io/bbolt (#939)

References

Summary by CodeRabbit

  • Chores
    • Updated underlying system and synchronization components to newer versions.
    • Improved embedded database compatibility through an updated implementation mapping.
    • No user-facing features or behavior changes.

…to remove MADV_RANDOM

Since Linux 6.4, MADV_RANDOM causes the kernel to aggressively evict
mmap'd pages, resulting in major page faults on bbolt's database file
and order-of-magnitude compaction duration increases. The RHEL 10 kernel
will not revert this behavior change, so the fix must be in bbolt.

This adds a go.mod replace directive pointing to a patched bbolt fork
with the MADV_RANDOM madvise hint removed. The replace should be dropped
once the fix is merged upstream (etcd-io/bbolt#939).

Ref: etcd-io/bbolt#939
Ref: https://redhat.atlassian.net/browse/OCPBUGS-103516

Assisted-by: Claude Code (Opus 4.6)
@openshift-ci-robot openshift-ci-robot added jira/severity-critical Referenced Jira bug's severity is critical for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Aug 4, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@hasbro17: This pull request references Jira Issue OCPBUGS-103516, which is invalid:

  • expected the bug to target the "5.0.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

Summary

Testing-only PR — the actual downstream fix should land via openshift/bbolt once that fork is synced to upstream v1.4.3.

This replaces the bbolt dependency with a patched fork hasbro17/bbolt@remove-madv-random that removes the madvise(MADV_RANDOM) call from bbolt's mmap path.

Since Linux 6.4 (torvalds/linux@8788f678), MADV_RANDOM causes the kernel to aggressively evict mmap'd pages by
short-circuiting the second-chance LRU mechanism. This results in high major page fault rates on bbolt's database file, particularly during compaction which sees order-of-magnitude duration increases. On OCP
5.0 FIPS clusters (RHCOS10, kernel 6.12), this manifests as a ~30% WAL fdatasync P99 latency regression.

This is the same root cause as OCPBUGS-50521 (OCP 4.19), which was fixed kernel-side by reverting the behavior change in RHEL 9.6. The RHEL kernel team has stated this behavior will not be reverted in RHEL 10,
so the fix must be in bbolt.

Next steps

  • Validate with perfscale CI on RHCOS10 FIPS clusters
  • Sync openshift/bbolt to upstream v1.4.3 and apply the patch there
  • Update this PR's replace directive to point to openshift/bbolt (or open a new PR)
  • Push the fix upstream to etcd-io/bbolt (#939)

References

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

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: 98020688-63df-43e2-90cf-165b30921132

📥 Commits

Reviewing files that changed from the base of the PR and between 64f8851 and 76de772.

⛔ 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 (4)
  • etcdutl/go.mod
  • go.mod
  • server/go.mod
  • tests/go.mod

Walkthrough

The pull request updates golang.org/x/sys and golang.org/x/sync versions in Go module files. It also adds a pinned replacement for go.etcd.io/bbolt in each module.

Changes

Module dependency alignment

Layer / File(s) Summary
Module requirements and bbolt replacements
go.mod, etcdutl/go.mod, server/go.mod, tests/go.mod
The modules update golang.org/x/sys to v0.47.0. tests/go.mod updates golang.org/x/sync to v0.22.0. Each module maps go.etcd.io/bbolt to the pinned github.com/hasbro17/bbolt revision.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Suggested reviewers: ivanvc, ar21sm

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the downstream change: replacing bbolt with a patched fork to remove MADV_RANDOM.
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 The commit changes only Go module metadata and checksums; no Go test files or Ginkgo test titles were added or modified.
Test Structure And Quality ✅ Passed The PR changes only Go module manifests and sums; no Ginkgo test code, setup, waits, or assertions changed, so this check is not applicable.
Microshift Test Compatibility ✅ Passed The PR changes only eight go.mod/go.sum files; the parent-to-HEAD diff adds no Ginkgo tests or MicroShift-incompatible API references.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The pull request changes only eight Go module and checksum files; it adds no Ginkgo e2e tests or other test declarations requiring SNO compatibility review.
Topology-Aware Scheduling Compatibility ✅ Passed The PR changes only go.mod and go.sum files; no deployment manifests, operator code, controllers, or scheduling constraints were added or modified.
Ote Binary Stdout Contract ✅ Passed The PR changes only go.mod/go.sum dependency metadata; it adds no Go source or process-level stdout writes.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The patch changes only four go.mod and four go.sum files; it adds no Go source, Ginkgo tests, or network operations.
No-Weak-Crypto ✅ Passed The commit changes only Go module metadata; it adds no Go source, weak-crypto API, custom crypto, or secret comparison, and the added bbolt replacement is non-cryptographic.
Container-Privileges ✅ Passed The PR changes only Go module and checksum files; the patch contains no privileged, host namespace, SYS_ADMIN, root, or allowPrivilegeEscalation settings.
No-Sensitive-Data-In-Logs ✅ Passed The commit changes only go.mod/go.sum dependency metadata; no logging code or sensitive-data values were added.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@openshift-ci
openshift-ci Bot requested review from deads2k and dusk125 August 4, 2026 20:42
@openshift-ci

openshift-ci Bot commented Aug 4, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hasbro17

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 Aug 4, 2026
@hasbro17

hasbro17 commented Aug 4, 2026

Copy link
Copy Markdown
Author

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Aug 4, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@hasbro17: This pull request references Jira Issue OCPBUGS-103516, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)
Details

In response to this:

Summary

Testing-only PR — the actual downstream fix should land via openshift/bbolt once that fork is synced to upstream v1.4.3.

This replaces the bbolt dependency with a patched fork hasbro17/bbolt@remove-madv-random that removes the madvise(MADV_RANDOM) call from bbolt's mmap path.

Since Linux 6.4 (torvalds/linux@8788f678), MADV_RANDOM causes the kernel to aggressively evict mmap'd pages by
short-circuiting the second-chance LRU mechanism. This results in high major page fault rates on bbolt's database file, particularly during compaction which sees order-of-magnitude duration increases. On OCP
5.0 FIPS clusters (RHCOS10, kernel 6.12), this manifests as a ~30% WAL fdatasync P99 latency regression.

This is the same root cause as OCPBUGS-50521 (OCP 4.19), which was fixed kernel-side by reverting the behavior change in RHEL 9.6. The RHEL kernel team has stated this behavior will not be reverted in RHEL 10,
so the fix must be in bbolt.

Next steps

  • Validate with perfscale CI on RHCOS10 FIPS clusters
  • Sync openshift/bbolt to upstream v1.4.3 and apply the patch there
  • Update this PR's replace directive to point to openshift/bbolt (or open a new PR)
  • Push the fix upstream to etcd-io/bbolt (#939)

References

Summary by CodeRabbit

  • Chores
  • Updated underlying system and synchronization components to newer versions.
  • Improved embedded database compatibility through an updated implementation mapping.
  • No user-facing features or behavior changes.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot

Copy link
Copy Markdown

@hasbro17: This pull request references Jira Issue OCPBUGS-103516, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)
Details

In response to this:

/jira refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@afcollins

Copy link
Copy Markdown

/pj-rehearse pull-ci-openshift-etcd-main-perfscale-control-plane-6nodes

@afcollins

Copy link
Copy Markdown

/test perfscale-control-plane-6nodes

@openshift-ci

openshift-ci Bot commented Aug 5, 2026

Copy link
Copy Markdown

@hasbro17: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/upstream-e2e 76de772 link false /test upstream-e2e
ci/prow/perfscale-control-plane-6nodes 76de772 link false /test perfscale-control-plane-6nodes
ci/prow/upstream-integration 76de772 link false /test upstream-integration

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@mcornea

mcornea commented Aug 5, 2026

Copy link
Copy Markdown

/payload-job periodic-ci-openshift-eng-ocp-perfscale-main-aws-5.0-nightly-x86-control-plane-fips-24nodes

@openshift-ci

openshift-ci Bot commented Aug 5, 2026

Copy link
Copy Markdown

@mcornea: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • periodic-ci-openshift-eng-ocp-perfscale-main-aws-5.0-nightly-x86-control-plane-fips-24nodes

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/45e4cef0-90a6-11f1-84e2-697c00fba475-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. jira/severity-critical Referenced Jira bug's severity is critical for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants