Skip to content
This repository was archived by the owner on Nov 4, 2022. It is now read-only.
This repository was archived by the owner on Nov 4, 2022. It is now read-only.

multiple threads writing to same disk causes issues with disk cleanup #214

@emillynge

Description

@emillynge

Hi

I realize that having stenographer use multiple threads witing to different directories on the same underlying disk may not be a supported use case.

But I really do have a viable use for this.

In such a setup, the automatic disk cleanup does not work as intended since cleanup is done in serial per thread. The first thread to do cleanup will then take on the burden of cleaning files until the desired percentage of free space is achieved. Only if the first thread has no more files left to delete will other threads using the same disk begin deleting their files.

I think there are 2 viable solutions:

  1. quick and dirty - randomize the order in which threads calls SyncFiles(). This will work fairly well as long as the threads write equal amounts of data.

  2. more complex - move deletion to Env and delete files alternatingly.

I already have a fork with solution 1) that I could turn into a PR if you would like it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions