Skip to content

Conversation

@skyzh
Copy link
Collaborator

@skyzh skyzh commented Jul 19, 2021

This PR adds GC for ZNS. Here's how it works:

  • We use the statistics interface added in fs: add statistics bzbd/zenfs#6, where we can get what size each file occupies in each zone.
  • We spawn a ZNSGC task in the background, which works like TTLGC. It polls statistics from ZenFS every 10s.
  • The task will find all full zones with 50% garbage (by default) and mark files in that zone for GC.

Along with ZNS GC, other features are added.

  • We added zenfs_gc_ratio option in db_bench command.
  • We fixed a bug where files may be deleted before closed.

Signed-off-by: Alex Chi iskyzh@gmail.com

This PR adds GC for ZNS. Here's how it works:

* We use the statistics interface added in
  bzbd/zenfs#6, where we can get what size
  each file occupies in each zone.
* We spawn a ZNSGC task in the background, which works like TTLGC.
  It polls statistics from ZenFS every 10s.
* The task will find all full zones with 50% garbage (by default)
  and mark files in that zone for GC.

Along with ZNS GC, other features are added.

* We added `zenfs_gc_ratio` option in db_bench command.
* We fixed a bug where files may be deleted before closed.

Signed-off-by: Alex Chi <iskyzh@gmail.com>
@skyzh
Copy link
Collaborator Author

skyzh commented Jul 19, 2021

ping @levisonchen @mm304321141 for review

skyzh added 8 commits July 19, 2021 11:36
Signed-off-by: Alex Chi <iskyzh@gmail.com>
Signed-off-by: Alex Chi <iskyzh@gmail.com>
Signed-off-by: Alex Chi <iskyzh@gmail.com>
Signed-off-by: Alex Chi <iskyzh@gmail.com>
Signed-off-by: Alex Chi <iskyzh@gmail.com>
Signed-off-by: Alex Chi <iskyzh@gmail.com>
Signed-off-by: Alex Chi <iskyzh@gmail.com>
Signed-off-by: Alex Chi <iskyzh@gmail.com>
Signed-off-by: Alex Chi <iskyzh@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants