Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avoid disk monitoring leaks under various conditions #18777

Merged
merged 2 commits into from Jan 12, 2024

Conversation

harshavardhana
Copy link
Member

Community Contribution License

All community contributions in this pull request are licensed to the project maintainers
under the terms of the Apache 2 license.
By creating this pull request, I represent that I have the right to license the
contributions to the project maintainers under the Apache 2 license.

Description

avoid disk monitoring leaks under various conditions

Motivation and Context

  • HealFormat() was leaking health check goroutines for disks; we are only
    interested in enabling health checks for the newly formatted disk,
    not existing disks.

  • When the disk is a root disk, a random disk monitor leaks while we
    ignore the drive.

  • When loading the disk for each erasure set, we were leaking goroutines
    for the prepare-storage.go disks, which were replaced via the globalLocalDrives
    slice

  • Avoid disk monitoring utilizing health tokens that would prematurely cause
    exhaustion in the tokens, which were meant for incoming I/O. This is ensured
    by avoiding writing O_DIRECT aligned buffer; instead, writing 2048 worth of
    content only as O_DSYNC, which is sufficient.

How to test this PR?

Hard to test but you need xfs_freeze to simulate the overall behavior

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Optimization (provides speedup with no functional changes)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • Fixes a regression (If yes, please add commit-id or PR # here)
  • Unit tests added/updated
  • Internal documentation updated
  • Create a documentation update request here

- HealFormat() was leaking healthcheck goroutines for
  disks, we are only interested in enabling healthcheck
  for the newly formatted disk not for existing disks.

- When disk is a root-disk a random disk monitor was
  leaking while we ignored the drive.

- When loading the disk for each erasure sets we were
  leaking goroutines for the prepare-storage.go disks
  which were replaced via the globalLocalDrives slice

- avoid disk monitoring utilizing health tokens that
  would cause exhaustion in the tokens, prematurely
  which were meant for incoming I/O. This is ensured
  by avoiding to write O_DIRECT aligned buffer instead
  write 2048 worth of content only as O_DSYNC which is
  sufficient.
Copy link
Contributor

@klauspost klauspost left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

@kobalicek kobalicek left a comment

Choose a reason for hiding this comment

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

LGTM

@harshavardhana harshavardhana merged commit e5c8794 into minio:master Jan 12, 2024
19 checks passed
@harshavardhana harshavardhana deleted the avoid-leaks branch January 12, 2024 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
next-release scheduled for upcoming release priority: high
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants