Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os/bluestore: More support for cleaning zones. #41919

Merged
merged 7 commits into from
Jun 30, 2021

Commits on Jun 22, 2021

  1. blk: Add functionality for resetting zones to HM-SMR device.

    Signed-off-by: Abutalib Aghayev <agayev@psu.edu>
    agayev committed Jun 22, 2021
    Configuration menu
    Copy the full SHA
    c211a5f View commit details
    Browse the repository at this point in the history
  2. os/bluestore: More support for cleaning zones.

    The protocol for cleaning zones is as follows:
    
    1. The ZonedAllocator wakes up the cleaner thread.
    2. The cleaner thread acquires the list of zones to clean
    3. Cleaning multiple zones is not atomic; therefore, to support resuming the
       cleaning if crashed, the cleaner thread first persists the list of zones to
       clean as a value of a key "cleaning_in_progress_zones", by calling
       ZonedFreelistManager's mark_zones_to_clean_in_progress.
    4. The cleaner thread then iterates over the zones and cleans zones by calling
       _zoned_clean_zone on each zone. The latter calls an operation
       _do_move on each live object on the zone that atomically moves an object from
       the cleaned zone to a new zone. (_do_move is to be implemented.)
    5. Once all of the zones are cleaned, the cleaner thread calls reset_zones,
       which resets the write pointer within the physical zoned block device
    6. Finally, it calls ZonedFreelistManager's mark_zones_to_clean_free method which
       in one atomic operation resets the write pointer of the cleaned zones in the
       db and deletes the key "cleaning_in_progress_zones", that is, the list of
       zones to be cleaned recorded in step 3.
    
    A crash between or within any of these steps will leave the system in consistent
    state. Specifically, each zone will either be completely cleaned, or partially
    cleaned, or not cleaned. A recovery code will need to check for the existence of
    the "cleaning_in_progress_zones" key and if found, it will resume cleaning zones
    where it left off. It is possible that if we crash between steps 5 and 6, or
    within step 5, we end resetting the write pointer within the physical zoned
    block device multiple times, but that's okay because the latter is an idempotent
    operation.
    
    Signed-off-by: Abutalib Aghayev <agayev@psu.edu>
    agayev committed Jun 22, 2021
    Configuration menu
    Copy the full SHA
    797e1a1 View commit details
    Browse the repository at this point in the history
  3. os/bluestore: Pass in parameters using a const reference instead of a…

    … pointer.
    
    Signed-off-by: Abutalib Aghayev <agayev@psu.edu>
    agayev committed Jun 22, 2021
    Configuration menu
    Copy the full SHA
    33fdd5e View commit details
    Browse the repository at this point in the history
  4. os/bluestore: Encode the whole set instead of encoding the elements o…

    …ne by one.
    
    Signed-off-by: Abutalib Aghayev <agayev@psu.edu>
    agayev committed Jun 22, 2021
    Configuration menu
    Copy the full SHA
    9802a25 View commit details
    Browse the repository at this point in the history
  5. os/bluestore: Add a method to ZonedFreelistManager retrieve the set o…

    …f zones
    
    recorded as being cleaned in the database.
    
    Signed-off-by: Abutalib Aghayev <agayev@psu.edu>
    agayev committed Jun 22, 2021
    Configuration menu
    Copy the full SHA
    95d672a View commit details
    Browse the repository at this point in the history
  6. os/bluestore: Resume cleaning after an unclean shutdown.

    Signed-off-by: Abutalib Aghayev <agayev@psu.edu>
    agayev committed Jun 22, 2021
    Configuration menu
    Copy the full SHA
    2459a3e View commit details
    Browse the repository at this point in the history
  7. blk: Initialized zoned block device descriptor.

    Signed-off-by: Abutalib Aghayev <agayev@psu.edu>
    agayev committed Jun 22, 2021
    Configuration menu
    Copy the full SHA
    b36774d View commit details
    Browse the repository at this point in the history