Will membase delete expired data or it will leave it in storage up to the next get request?
Will membase delete expired data or it will leave it in storage up to the next get request?
How long did you wait for the items to expire? I believe the way it works is that there is a thread that removes expired items which runs off and on throughout the day. It might take up to an hour or so before the items actually disappear.
We haven't had any issues with active items expiring, replica's on the other hand...
i added one key to membase that not used by anybody. Set expiration to 1 second, waited 1 minute and then check count of items in membase console -> it still was 1. And only adter get request item was deleted.
That's not enough time to wait for the key to expire. I believe the thread that deletes expired items runs once per hour. Items won't immediately be deleted the very second they expire.
depends on the bucket type.
a memcached bucket has a lazy expiration - meaning that if the key is expired it will stay in memory and next time it is requested it is deleted and a key not found is returned
membase buckets have the expiration checked hourly and the key is deleted if expired.
Alex, is there a separate thread that handles expiring replica items in a membase bucket?
The thread that Alex is talking about for Membase buckets will remove all expired items. This includes items in replica vbuckets.
Mike,
Not all replica items get expired. I posted a bug a few months ago when 1.7.1 came out where replicas get left even after expiring. It's possible that we are the only ones who see it though since we set/expire millions of keys a day.
http://www.couchbase.org/forums/thread/left-over-replicas-after-expiration
Dan,
Just wanted to let you know that this has been fixed for Membase 1.8 which we will be releasing soon. If you get a chance to upgrade and are still seeing issues please let us know.
Mike, I look forward to upgrading when 1.8 comes out. Will we be able to do rolling upgrades from 1.7.1 to 1.8 or will it require taking the entire cluster down and upgrading every node at once?
Thanks,
Dan
Dan,
I wanted to inform you that our QA team found a leak in expired items in 1.8. It appears that our fix didn't fully solve this issue. We have it marked as a blocker for the 1.8.1 release. I apologize for not waiting until our QA team properly closed the issue before informing you of this fix. Hopefully, the fix that was put in helps make the problem less severe.
Also, the upgrade path should be rolling upgrade, but you should double check the release notes before doing so.
Thanks for the update Mike. I'll probably hold off updating until the 1.8.1 release since it's a rather big process to upgrade the cluster.
Dan
Sorry guys, but i found new interesting topic in manual of membase 1.8. Here it is: http://www.couchbase.com/docs/couchbase-manual-1.8/couchbase-developing-...
Mostly i concerned about this paragraph:
"Note that expiration algorithm is lazy and will consume resources until the item is actually retrieved, at which point the expiration timestamps are checked."
So i will ask again will membase delete expired keys, or i must do GET request to expire them??
Couchbase Server (and Membase Server) will delete expired keys. There is a background job which runs once per hour to remove any deleted items or they are removed upon access. They won't consume resources forever and you don't need to wait for a GET to have them removed.
So why then manual says that membase will not delete them?
Problem is that, that after i start saving session data to membase, number of items is greatly increased and continues to grow. So i think that there could be a bug with key expiration.
Where? The page you pointed to says it will delete them when an expiration is set: "The item expiration feature of Couchbase can be optionally used to have Couchbase automatically delete old sessions."
There was a bug in 1.7, but that has long been fixed.
We use Membase 1.7.1. In what version bug was fixed/
The bug, linked above, is only in cases where the item expires in a short timeframe like a couple of seconds.
That said, I'd really, really recommend upgrading to 1.8.0. There are many known issues fixed. Look at the release notes at couchbase.com/docs for details.
I just tested this on my membase server and can say that membase does not delete data by itself, it wait for next get request and when it see that data already expired then and only the membase delete it.
So second question how can i delete all expired keys? (memdump for some reason don't work with membase)