Skip to content
  • Maysam Yabandeh's avatar
    WritePrepared: snapshot should be larger than max_evicted_seq_ (#4886) · cad99a60
    Maysam Yabandeh authored
    Summary:
    The AdvanceMaxEvictedSeq algorithm assumes that new snapshots always have sequence number larger than the last max_evicted_seq_. To enforce this assumption we make two changes:
    i) max is not advanced beyond the last published seq, with the exception that the evicted commit entry itself is not published yet, which is quite rare.
    ii) When obtaining the snapshot if the max_evicted_seq_ is not published yet, commit a dummy entry so that it waits for it to be published and also increased the latest published seq by one above the max.
    To test these non-realistic corner cases we create a commit cache with size 1 so that every single commit results into eviction.
    Pull Request resolved: https://github.com/facebook/rocksdb/pull/4886
    
    Differential Revision: D13685270
    
    Pulled By: maysamyabandeh
    
    fbshipit-source-id: 5461bc09c2a9b75798bfcb9853a256c81cdac0b0
    cad99a60