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

Do not truncate WAL if in read_only mode #8313

Closed
wants to merge 13 commits into from

Commits on May 18, 2021

  1. Do not truncate WAL if in read_only mode

    Noticed ```openat``` system call with ```O_WRONLY``` flag and ```sync_file_range``` and ```truncate``` on WAL file when using ```rocksdb::DB::OpenForReadOnly``` by way of ```db_bench --readonly=true --benchmarks=readseq --use_existing_db=1 --num=1 ...```
      I think introduced by facebook@7d7f144
    thatsafunnyname committed May 18, 2021
    Configuration menu
    Copy the full SHA
    32cfdfa View commit details
    Browse the repository at this point in the history

Commits on May 21, 2021

  1. Test mtime of files after ReadOnlyReopen

    This catches the WAL file being truncated and the modification time on it changing.
    I am not sure if a mock filesystem with mock clock could be used to avoid having to sleep 1.1s.
    The test could also check the set of files is the same and that the sizes are also unchanged.
    
    Before:
     
    [ RUN      ] DBBasicTest.ReadOnlyReopenMtimeUnchanged
    db/db_basic_test.cc:182: Failure
    Expected equality of these values:
      file_mtime_after_readonly_reopen
        Which is: 1621611136
      file_mtime_before_readonly_reopen
        Which is: 1621611135
      file is: 000010.log
    [  FAILED  ] DBBasicTest.ReadOnlyReopenMtimeUnchanged (1108 ms)
    
    
    After:
     
    [ RUN      ] DBBasicTest.ReadOnlyReopenMtimeUnchanged
    [       OK ] DBBasicTest.ReadOnlyReopenMtimeUnchanged (1108 ms)
    thatsafunnyname committed May 21, 2021
    Configuration menu
    Copy the full SHA
    f493b75 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8980c3a View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    e089397 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    b75cd8f View commit details
    Browse the repository at this point in the history

Commits on May 22, 2021

  1. Configuration menu
    Copy the full SHA
    cec1ad5 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    96f972b View commit details
    Browse the repository at this point in the history

Commits on May 23, 2021

  1. Configuration menu
    Copy the full SHA
    25234ae View commit details
    Browse the repository at this point in the history

Commits on May 24, 2021

  1. Configuration menu
    Copy the full SHA
    625f9b8 View commit details
    Browse the repository at this point in the history
  2. Update test

    jay-zhuang committed May 24, 2021
    Configuration menu
    Copy the full SHA
    d9b15c1 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    f17fb19 View commit details
    Browse the repository at this point in the history
  4. update comment

    jay-zhuang committed May 24, 2021
    Configuration menu
    Copy the full SHA
    8679316 View commit details
    Browse the repository at this point in the history

Commits on May 25, 2021

  1. update

    jay-zhuang committed May 25, 2021
    Configuration menu
    Copy the full SHA
    60d38f6 View commit details
    Browse the repository at this point in the history