• Y
    Add timestamp to delete (#6253) · 961c7590
    Yanqin Jin 提交于
    Summary:
    Preliminary user-timestamp support for delete.
    
    If ["a", ts=100] exists, you can delete it by calling `DB::Delete(write_options, key)` in which `write_options.timestamp` points to a `ts` higher than 100.
    
    Implementation
    A new ValueType, i.e. `kTypeDeletionWithTimestamp` is added for deletion marker with timestamp.
    The reason for a separate `kTypeDeletionWithTimestamp`: RocksDB may drop tombstones (keys with kTypeDeletion) when compacting them to the bottom level. This is OK and useful if timestamp is disabled. When timestamp is enabled, should we still reuse `kTypeDeletion`, we may drop the tombstone with a more recent timestamp, causing deleted keys to re-appear.
    
    Test plan (dev server)
    ```
    make check
    ```
    Pull Request resolved: https://github.com/facebook/rocksdb/pull/6253
    
    Reviewed By: ltamasi
    
    Differential Revision: D20995328
    
    Pulled By: riversand963
    
    fbshipit-source-id: a9e5c22968ad76f98e3dc6ee0151265a3f0df619
    961c7590
db_iter.cc 48.5 KB