Odd curr_items behaviour when setting expiration
Hi,
I'm seeing some odd behaviour with curr_items i can't explain...
When using membase buckets if i set an expiry on a key, wait for it to expire then set the same key, the curr_items (and vb_active_curr_items) keeps increasing. Setting the same key before the expiry works as i expected (ie; curr_items doesn't increment).
It gets even weirder when deleting it - DELETEing the same key over and over decrements curr_items as if the key has been stored multiple times.
c> SET testkey1 0 10 1 a s> STAT curr_items 1 (wait 10s) c> SET testkey1 0 10 1 a s> STAT curr_items 2 (wait 10s) c> SET testkey1 0 10 1 a s> STAT curr_items 3 c> DELETE testkey1 s> DELETED s> STAT curr_items 2 c> DELETE testkey1 s> NOT_FOUND s> STAT curr_items 1 c> DELETE testkey1 s> NOT_FOUND s> STAT curr_items 0
Is this expected? Is the key actually being stored multiple times (it seems that way, or at least it seems to have this stack-like behaviour per key)?
I'm running 1.7GA and see the same effect either on a single node or cluster (with or without replication). I've tried with telnet and a PHP client. Memcache buckets don't seem to increment curr_items after the expiry has passed.
Is this normal?
Thanks,
-kieren
kieren,
>>When using membase buckets if i set an expiry on a key, wait for it to expire then set the same key, the curr_items (and vb_active_curr_items) keeps increasing. Setting >>the same key before the expiry works as i expected (ie; curr_items doesn't increment).
In general items which do expire are flushed out of memory every 60 minutes ( its a parameter passed to ep-engine during memcached startup)
"
set x , expiry = 40 mins
after 80 mins ( item has already been flushed from memory)
set x again expiry = 40 mins
"
>>Is this expected? Is the key actually being stored multiple times (it seems that way, or at least it seems to have this stack-like behaviour per key)?
it is not expected per design but it is a known issue in 1.7.0 release ( with the fix already coming in in 1.7.1 release) that if you set the item again before expiry pager flushed the item out of memory membase tends to create a new object in memory instead of replacing the old one
http://www.couchbase.org/issues/browse/MB-3972