Skip to content

mma: disk utilization modeling is off #162245

Description

@wenyihu6

Describe the problem

mma's ByteSize capacity derivation uses filesystem utilization (Capacity - Available) / Capacity to derive a logical capacity. However, this assumes that physical bytes and logical bytes scale proportionally, which is not accurate due to fixed disk overhead (reserved blocks, ballast, other files).

load[mmaprototype.ByteSize] = mmaprototype.LoadValue(desc.Capacity.LogicalBytes)
// Available does not compensate for the ballast, so utilization will look
// higher than actual. This is fine since the ballast is small (default is
// 1% of capacity) and is for use in an emergency.
byteSizeUtil :=
float64(desc.Capacity.Capacity-desc.Capacity.Available) / float64(desc.Capacity.Capacity)
almostZeroUtil := byteSizeUtil < 0.01
if load[mmaprototype.ByteSize] != 0 && !almostZeroUtil {
// Normal case. The store has some ranges, and is not almost empty.
capacity[mmaprototype.ByteSize] = mmaprototype.LoadValue(float64(load[mmaprototype.ByteSize]) / byteSizeUtil)

(Capacity - Available) includes:

  1. capacity.used (which includes ballast file (~1% of disk))
  2. reserved blocks (~5% on ext4)
  3. other files outside of the cockroachdb directory (core dumps, etc.)

These fixed overheads don't scale with LogicalBytes, causing:

  • Underestimated capacity for small stores: when LogicalBytes is small, fixed overhead dominates, making cpacity appear much lower than it should be.
  • Inconsistent derived capacity: derived capacity[ByteSize] varies based on fixed overhead, not just the actual data.

Jira issue: CRDB-59337

Epic CRDB-55052

Activity

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

Metadata

Metadata

Assignees

Labels

A-kvAnything in KV that doesn't belong in a more specific category.A-kv-distributionRelating to rebalancing and leasing.C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.P-3Issues/test failures with no fix SLAT-kvKV Teambranch-masterFailures and bugs on the master branch.branch-release-26.1Used to mark GA and release blockers, technical advisories, and bugs for 26.1target-release-26.1.1target-release-26.2.0v26.1.1v26.2.0-prerelease

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions