Dynamically setting bucket time-to-live on Riak and Bitcask with riak-js

269 Views Asked by At

Is it possible to change the expiry_secs parameter on bitcask buckets dynamically? Calling riak.saveBucket('bucket', {expiry_secs: 60}); will cause subsequent calls of riak.getBucket('bucket') to report 60 as the key ttl, but keys never seem to expire.

Is there a separate setting that needs to be modified, or can expiry_secs only be set in Riak's app.config and not from a client application?

1

There are 1 best solutions below

0
On BEST ANSWER

Unfortunately, no. Bitcask handles expiry at the backend level, not the bucket level. When Riak starts, each Bitcask backend reads the current expiry_secs from the application environment and stores it in its internal state. While you can change the setting using the set_env function, the backends would not recognize that until something caused them to restart.