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

Gh62 badrecord mstate #64

Merged
merged 5 commits into from Oct 23, 2012
Merged

Gh62 badrecord mstate #64

merged 5 commits into from Oct 23, 2012

Commits on Oct 18, 2012

  1. Add test to trigger {badrecord,mstate} error.

    Modify the truncated_merge_test() function to trigger
    the error that we're looking for ... there are a couple
    of other ways that we could possibly corrupt the fold
    accumulator so that merge would be confused, but we
    won't try to address other other methods here.
    
    A successful test failure (heh!) is when a test fails
    with this output:
    
        =ERROR REPORT==== 17-Oct-2012::23:50:29 ===
        bitcask_fileops:fold: /tmp/bc.test.truncmerge/2.bitcask.data: expected 14 bytes but got only 5 bytes, skipping
        *failed*
        in function bitcask:merge_files/1 (src/bitcask.erl, line 860)
        in call from bitcask:merge1/3 (src/bitcask.erl, line 510)
        in call from bitcask:truncated_merge_test/0 (src/bitcask.erl, line 1649)
        **error:{badrecord,mstate}
    slfritchie committed Oct 18, 2012
    Copy the full SHA
    ba92663 View commit details
    Browse the repository at this point in the history
  2. Avoid fold accumulator corruption caused by I/O & CRC errors

    In case of I/O or CRC error, use `throw` to throw details
    about the error and the partial accumulator all the way
    back to the caller.
    slfritchie committed Oct 18, 2012
    Copy the full SHA
    7501a34 View commit details
    Browse the repository at this point in the history
  3. Change behavior on CRC error

    The old behavior, return a seemingly-corrupted accumulator,
    or the new behavior, throw an error and abort subsequent
    processing of this data file, are both bad.  So, we do
    something different: we continue.
    
    If the CRC is good, we call the fold function and get a
    new accumulator.  If the CRC is bad, we complain and
    use the old accumulator.  In either case, we continue
    processing (what we hope are valid contents of) the
    rest of the file.
    slfritchie committed Oct 18, 2012
    Copy the full SHA
    a9aada3 View commit details
    Browse the repository at this point in the history
  4. Copy the full SHA
    72d3b52 View commit details
    Browse the repository at this point in the history
  5. Copy the full SHA
    68dae7d View commit details
    Browse the repository at this point in the history