Closed Menziess closed 1 year ago
Hi. This is not a bug. The following is from rocksdb:
Some warnings:
Calling DB::Open directly to re-open a db created by this API will get corrupt values(timestamp suffixed) and no ttl effect will be there during the second Open, so use this API consistently to open the db Be careful when passing ttl with a small positive value because the whole database may be deleted in a small amount of time
It basically says that the time stamp is suffixed to the value in ttl mode. So to correctly read it reopen the database also in ttl mode.
Okay, for me that was unexpected at least. But that explains it.
Steps
Describe the bug When writing a value to rocksdb using the
with_ttl
mode, while reading the value using any other mode, a utf-8 decoding error occurs.To Reproduce Create db using
with_ttl
, write, close it. Then create the db usingread_only
, read, error:Expected behavior Expected that the value was read, just as it was using
with_ttl
mode. Additional info: