Hi Lucas, I've tried reproducing this using a local Riak 2.0.1 node, however TTL is working as expected.
Here is the configuration I have in /etc/riak/riak.conf: storage_backend = multi multi_backend.default = bc_default multi_backend.ttl_stg.storage_backend = memory multi_backend.ttl_stg.memory_backend.ttl = 90s multi_backend.ttl_stg.memory_backend.max_memory_per_vnode = 4MB multi_backend.bc_default.storage_backend = bitcask multi_backend.bc_default.bitcask.data_root = /var/lib/riak/bc_default multi_backend.bc_default.bitcask.io_mode = erlang This translates to the following in /var/lib/riak/generated.configs/app.2014.10.13.13.13.29.config: {multi_backend_default,<<"bc_default">>}, {multi_backend, [{<<"ttl_stg">>,riak_kv_memory_backend,[{ttl,90},{max_memory,4}]}, {<<"bc_default">>,riak_kv_bitcask_backend, [{io_mode,erlang}, {expiry_grace_time,0}, {small_file_threshold,10485760}, {dead_bytes_threshold,134217728}, {frag_threshold,40}, {dead_bytes_merge_trigger,536870912}, {frag_merge_trigger,60}, {max_file_size,2147483648}, {open_timeout,4}, {data_root,"/var/lib/riak/bc_default"}, {sync_strategy,none}, {merge_window,always}, {max_fold_age,-1}, {max_fold_puts,0}, {expiry_secs,-1}, {require_hint_crc,true}]}]}]}, I set the bucket properties to use the ttl_stg backend: root@UBUNTU-12-1:~# cat ttl_stg-props.json {"props":{"name":"ttl_stg","backend":"ttl_stg"}} root@UBUNTU-12-1:~# curl -XPUT -H'Content-type: application/json' localhost:8098/buckets/ttl_stg/props --data-ascii @ttl_stg-props.json root@UBUNTU-12-1:~# curl -XGET localhost:8098/buckets/ttl_stg/props {"props":{"allow_mult":false,"backend":"ttl_stg","basic_quorum":false,"big_vclock":50,"chash_keyfun":{"mod":"riak_core_util","fun":"chash_std_keyfun"},"dvv_enabled":false,"dw":"quorum","last_write_wins":false,"linkfun":{"mod":"riak_kv_wm_link_walker","fun":"mapreduce_linkfun"},"n_val":3,"name":"ttl_stg","notfound_ok":true,"old_vclock":86400,"postcommit":[],"pr":0,"precommit":[],"pw":0,"r":"quorum","rw":"quorum","small_vclock":50,"w":"quorum","young_vclock":20}} And used the following statement to PUT test data: curl -XPUT localhost:8098/buckets/ttl_stg/keys/1 -d "TEST $(date)" After 90 seconds, this is the response I get from Riak: root@UBUNTU-12-1:~# curl -XGET localhost:8098/buckets/ttl_stg/keys/1 not found I would carefully check all of the app.config / riak.conf files in your cluster, the output of "riak config effective" and the bucket properties for those buckets you expect to be using the memory backend with TTL. I also recommend using the localhost:8098/buckets/ endpoint instead of the deprecated riak/ endpoint. Please let me know if you have additional questions. -- Luke Bakken Engineer / CSE lbak...@basho.com On Fri, Oct 3, 2014 at 11:32 AM, Lucas Grijander <lucasgrinjande...@gmail.com> wrote: > Hello, > > I have a memory backend in production with Riak 2.0.1, 4 servers and 256 > vnodes. The servers have the same date and time. > > I have seen an odd performance with the ttl. > > This is the config: > > {<<"ttl_stg">>,riak_kv_memory_backend, > [{ttl,90},{max_memory,25}]}, > > For example, see this GET response in one of the riak servers: > > < HTTP/1.1 200 OK > < X-Riak-Vclock: a85hYGBgzGDKBVIc4otdfgR/7bfIYEpkzGNlKI1efJYvCwA= > < Vary: Accept-Encoding > * Server MochiWeb/1.1 WebMachine/1.10.5 (jokes are better explained) is not > blacklisted > < Server: MochiWeb/1.1 WebMachine/1.10.5 (jokes are better explained) > < Link: </riak/ttl_stg>; rel="up" > < Last-Modified: Fri, 03 Oct 2014 17:40:05 GMT > < ETag: "3c8bGoifWcOCSVn0otD5nI" > < Date: Fri, 03 Oct 2014 17:47:50 GMT > < Content-Type: application/json > < Content-Length: 17 > > If the TTL is 90 seconds, Why the GET doesn't return "not found" if the > difference between "Last-Modified" and "Date" (of the curl request) is > greater than the TTL? > > Thanks in advance! > > > _______________________________________________ > riak-users mailing list > riak-users@lists.basho.com > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com > _______________________________________________ riak-users mailing list riak-users@lists.basho.com http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com