Skip to content

Compaction does not remove entry files when remaining file size < Compaction Threshold #3711

@sourabhaggrawal

Description

@sourabhaggrawal

BUG REPORT

Describe the bug
Whenever major or minor compaction runs, it does not remove the log files which has utilised more than threshold value. But only remove the files with usage < threshold.

A clear and concise description of what the bug is.
I am seeing high disk usage in ledger directory in 3 bookie cluster, all 3 nodes have couple of log files with size 1.1GB which is the default max entry log file size before it creates a new one.
As per the documentation here for Major and Minor Compaction, it is supposed to delete the log files when remaining log file size reaches below threshold.
When trying to debug this in code found that condition is checking for meta.Usage > threshold and ignore the meta file which is supposed to get deleted, what I feel it should be checking the meta.Remaining > Threshold.

if (meta.getUsage() >= threshold || (maxTimeMillis > 0 && timeDiff.getValue() >= maxTimeMillis)

To Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

  • Compaction should have removed the file if remaining file size < threshold.

Screenshots

If applicable, add screenshots to help explain your problem.
Screenshot 2022-12-22 at 1 02 33 PM

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions