Summary
The C API has no way to issue a range deletion with a user-defined timestamp. DB::DeleteRange has had a UDT overload (DeleteRange(const WriteOptions&, ColumnFamilyHandle*, const Slice& begin, const Slice& end, const Slice& ts)) on the C++ side for years, but the C API only exposes the non-timestamped rocksdb_delete_range_cf. There is no rocksdb_delete_range_cf_with_ts.
This leaves a gap for C and FFI consumers (e.g. the rust-rocksdb bindings): on a column family that enables user-defined timestamps, you can issue timestamped point deletes (rocksdb_delete_cf_with_ts, rocksdb_singledelete_cf_with_ts) but you cannot issue a timestamped range delete at all.
Background
The original UDT C-API work (#9889 / #9914) added timestamped Get, MultiGet, Delete, and SingleDelete, but did not include range deletes. This issue tracks completing that surface with the one missing entry point.
Proposed API
extern ROCKSDB_LIBRARY_API void rocksdb_delete_range_cf_with_ts(
rocksdb_t* db, const rocksdb_writeoptions_t* options,
rocksdb_column_family_handle_t* column_family, const char* start_key,
size_t start_key_len, const char* end_key, size_t end_key_len,
const char* ts, size_t tslen, char** errptr);
A thin forwarder to the existing C++ overload, modeled exactly on rocksdb_delete_cf_with_ts (for the Slice(ts, tslen) + SaveError pattern) and rocksdb_delete_range_cf (for the begin/end key plumbing).
Environment
- RocksDB:
main (also reproduces on the 11.x releases)
- C API header:
include/rocksdb/c.h
I have a patch ready (header declaration, db/c.cc implementation, a db/c_test.c case covering write-at-ts then delete-range-at-later-ts then read-at-later-ts, and an unreleased_history note) and am happy to open a PR.
Summary
The C API has no way to issue a range deletion with a user-defined timestamp.
DB::DeleteRangehas had a UDT overload (DeleteRange(const WriteOptions&, ColumnFamilyHandle*, const Slice& begin, const Slice& end, const Slice& ts)) on the C++ side for years, but the C API only exposes the non-timestampedrocksdb_delete_range_cf. There is norocksdb_delete_range_cf_with_ts.This leaves a gap for C and FFI consumers (e.g. the
rust-rocksdbbindings): on a column family that enables user-defined timestamps, you can issue timestamped point deletes (rocksdb_delete_cf_with_ts,rocksdb_singledelete_cf_with_ts) but you cannot issue a timestamped range delete at all.Background
The original UDT C-API work (#9889 / #9914) added timestamped Get, MultiGet, Delete, and SingleDelete, but did not include range deletes. This issue tracks completing that surface with the one missing entry point.
Proposed API
A thin forwarder to the existing C++ overload, modeled exactly on
rocksdb_delete_cf_with_ts(for theSlice(ts, tslen)+SaveErrorpattern) androcksdb_delete_range_cf(for the begin/end key plumbing).Environment
main(also reproduces on the 11.x releases)include/rocksdb/c.hI have a patch ready (header declaration,
db/c.ccimplementation, adb/c_test.ccase covering write-at-ts then delete-range-at-later-ts then read-at-later-ts, and anunreleased_historynote) and am happy to open a PR.