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

delay storage operations for an extent that is transitioning from uninited to initialized state #1578

Merged
merged 1 commit into from
Sep 21, 2021

Commits on Sep 21, 2021

  1. delay storage operations for an extent that is transitioning from uni…

    …nited to initialized state
    
    When a file extent that is marked as uninited is written to, all sectors
    corresponding to the extent are written, including both the data from the
    write request and any zeroed area(s) surrounding it. This presents a problem
    when subsequent storage requests are issued on behalf of the extent. Such
    requests may be made without first waiting for completion of the initializing
    write. This property of the pagecache - that requests are issued without first
    waiting for completions for prior requests - is typically not an issue, for
    read data is cached and not re-read after a write, and writes are posted from
    the same pagecache buffer, making the order of write completions
    irrelevant. But the areas of an extent outside of the initial write request,
    which are written with zeros, could be subsequently read into the cache (or
    pages overwritten as a whole) prior to the zero writes completing. This has
    been found to lead to spurious inconsistent data being read - namely, areas
    that should be zero are read and found to contain nonzero data.
    
    To ameliorate this condition, the uninited flag has been changed into an
    optional record that becomes allocated when a write is first posted to an
    uninited extent. When subsequent storage requests are made to the extent
    before the initializing writes complete, they are added to a queue within the
    uninited record. On completion of the initializing writes, the queued
    requests are then dispatched, and the uninited state is set to 'initialized',
    indicating that further operations on the extent should occur normally, as if
    uninited was not set. (Given that extent references are not tracked and that
    the extents themselves may be deallocated at any time, the uninited completion
    never refers to the extent itself, and the record exists for the lifetime of
    the extent - thus the uninited 'initialized' state having the same semantics
    as a null uninited field.)
    wjhun committed Sep 21, 2021
    Configuration menu
    Copy the full SHA
    432bd88 View commit details
    Browse the repository at this point in the history