• Y
    Add more verification to db_stress (#6173) · 670a916d
    Yanqin Jin 提交于
    Summary:
    Currently, db_stress performs verification by calling `VerifyDb()` at the end of test and optionally before tests start. In case of corruption or incorrect result, it will be too late. This PR adds more verification in two ways.
    1. For cf consistency test, each test thread takes a snapshot and verifies every N ops. N is configurable via `-verify_db_one_in`. This option is not supported in other stress tests.
    2. For cf consistency test, we use another background thread in which a secondary instance periodically tails the primary (interval is configurable). We verify the secondary. Once an error is detected, we terminate the test and report. This does not affect other stress tests.
    
    Test plan (devserver)
    ```
    $./db_stress -test_cf_consistency -verify_db_one_in=0 -ops_per_thread=100000 -continuous_verification_interval=100
    $./db_stress -test_cf_consistency -verify_db_one_in=1000 -ops_per_thread=10000 -continuous_verification_interval=0
    $make crash_test
    ```
    Pull Request resolved: https://github.com/facebook/rocksdb/pull/6173
    
    Differential Revision: D19047367
    
    Pulled By: riversand963
    
    fbshipit-source-id: aeed584ad71f9310c111445f34975e5ab47a0615
    670a916d
db_stress_test_base.h 8.3 KB