Skip to content

AOF truncation ignores configured SegmentSize, always uses default 1 GB granularity #1795

Description

@rdavisunr

Describe the bug

From reviewing GarnetServerOptions.GetAofSettings(), it appears that SegmentSize is not set on TsavoriteLogSettings, causing AOF creation and deletion/truncation to operate at the default 1 GB segment size and preventing truncation at smaller configured sizes.

I have Garnet configured with:

{
    "EnableAOF": true,
    "AofPageSize": "8m",
    "AofSizeLimit": "256m",
    "SegmentSize": "64m",
    "Recover": true,
}
  • Once AofSizeLimit (256 MB) is reached, a checkpoint is taken as expected.
  • After the checkpoint completes, the AOF is not truncated.
  • A single AOF file named aof.log.0 continues to grow past the size limit (see screenshot)

Suspect file creation and truncation are still configured at the default 1 GB segment granularity.

Referencing this discussion: #166 (reply in thread)

File deletion/truncation happens at the granularity of segment size, which is by default 1GB.
...
For these smaller scales, you could use a smaller segment size specified via SegmentSize argument in options.
Segment size identifies the size of each file created as part of the AOF. We add and remove at this file granularity.

Based on that discussion, I would expect SegmentSize to control AOF file creation and deletion granularity.

However, I recognize this discussion was more than two years ago, so perhaps the behavior or configuration has changed?

Steps to reproduce the bug

Configure Garnet as shown in the Summary and observe behavior after AofSizeLimit is reached.

Expected behavior

Based on the discussion, AOF file truncation should occur at the configured SegmentSize (64 MB in this example), allowing files to be deleted after a checkpoint.

Screenshots

Image

Release version

v1.1.6

IDE

No response

OS version

No response

Additional context

No response

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Fields

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