Couchbase
  • Why NoSQL?
  • Couchbase Server
  • Download
  • Resources
  • Careers
Home | Forums | Membase | Membase Server 1.7.x

Will membase delete expired data or it will leave it in storage up to the next get request?

18 replies [Last post]
  • Login or register to post comments
Mon, 11/14/2011 - 02:40
creotiv
Offline
Joined: 11/14/2011
Groups: None

Will membase delete expired data or it will leave it in storage up to the next get request?

Top
  • Login or register to post comments
Mon, 11/14/2011 - 02:46
creotiv
Offline
Joined: 11/14/2011
Groups: None

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)

Top
  • Login or register to post comments
Mon, 11/14/2011 - 08:29
dan
Offline
Joined: 01/05/2011
Groups: None

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...

Top
  • Login or register to post comments
Mon, 11/14/2011 - 09:44
creotiv
Offline
Joined: 11/14/2011
Groups: None

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.

Top
  • Login or register to post comments
Mon, 11/14/2011 - 09:47
dan
Offline
Joined: 01/05/2011
Groups: None

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.

Top
  • Login or register to post comments
Mon, 11/14/2011 - 12:14
alex
Offline
Joined: 08/29/2011
Groups: None

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.

Top
  • Login or register to post comments
Mon, 11/14/2011 - 12:28
dan
Offline
Joined: 01/05/2011
Groups: None

Alex, is there a separate thread that handles expiring replica items in a membase bucket?

Top
  • Login or register to post comments
Tue, 11/15/2011 - 11:38
mikew
Offline
Joined: 03/14/2011
Groups:

The thread that Alex is talking about for Membase buckets will remove all expired items. This includes items in replica vbuckets.

Top
  • Login or register to post comments
Tue, 11/15/2011 - 11:58
dan
Offline
Joined: 01/05/2011
Groups: None

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

Top
  • Login or register to post comments
Tue, 12/20/2011 - 13:29
mikew
Offline
Joined: 03/14/2011
Groups:

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.

http://www.couchbase.org/issues/browse/MB-4292

Top
  • Login or register to post comments
Sat, 01/07/2012 - 08:05
dan
Offline
Joined: 01/05/2011
Groups: None

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

Top
  • Login or register to post comments
Mon, 01/09/2012 - 11:41
mikew
Offline
Joined: 03/14/2011
Groups:

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.

Top
  • Login or register to post comments
Tue, 01/10/2012 - 15:35
dan
Offline
Joined: 01/05/2011
Groups: None

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

Top
  • Login or register to post comments
Mon, 02/20/2012 - 10:00
creotiv
Offline
Joined: 11/14/2011
Groups: None

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??

Top
  • Login or register to post comments
Mon, 02/20/2012 - 10:19
ingenthr
Offline
Joined: 03/16/2010
Groups:

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.

Top
  • Login or register to post comments
Mon, 02/20/2012 - 12:28
creotiv
Offline
Joined: 11/14/2011
Groups: None

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.

Top
  • Login or register to post comments
Mon, 02/20/2012 - 13:06
ingenthr
Offline
Joined: 03/16/2010
Groups:

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.

Top
  • Login or register to post comments
Mon, 02/20/2012 - 13:23
creotiv
Offline
Joined: 11/14/2011
Groups: None

We use Membase 1.7.1. In what version bug was fixed/

Top
  • Login or register to post comments
Mon, 02/20/2012 - 14:13
ingenthr
Offline
Joined: 03/16/2010
Groups:

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.

Top
  • Login or register to post comments
  • Login or register to post comments
  • Login
  • Register

Company

  • About Us
  • Leadership
  • Customers
  • Partners
  • Contact Us

Product

  • Couchbase Server
  • Couchbase SDKs
  • Use Cases
  • Documentation
  • Forums

Open Source

  • Couchbase Project
  • Couchbase vs. CouchDB

Commercial

  • Subscriptions & Support
  • Training & Services

News

  • Blog
  • Newsletter
  • Press Releases
  • Buzz

Follow Us

    
  • Customer Login
  • Terms of Service
  • Privacy Policy
  • Trademark Policy
  • Site Map

© 2013 COUCHBASE All rights reserved.

Sign in to Couchbase Community

close
  • Create new account
  • Request new password
You are logging into the Forums, Wiki and Issue Tracker