Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Clobbering updates & CAS
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  9 messages - Expand all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Ren  
View profile  
 More options Aug 6 2009, 9:26 am
From: Ren <Jared.Willi...@ntlworld.com>
Date: Thu, 6 Aug 2009 06:26:26 -0700 (PDT)
Local: Thurs, Aug 6 2009 9:26 am
Subject: Clobbering updates & CAS

The FAQ outlines a method of reducing the effects of clobbering
updates, by use of an embedded expiration value.

http://code.google.com/p/memcached/wiki/FAQ#How_to_prevent_clobbering...

"Then, when you get from the cache and examine the timeout and find it
expired, immediately edit the embedded timeout to a time in the future
and re-store the data as is."

If a CAS operation is used here, wouldn't it prevent others from doing
unnecessary work?

If the CAS operation succeeds, then its the currently running tasks
responsibility to refresh the data in the cache, if it fails with
RES_DATA_EXISTS, then someone else is taking care of the update.

Jared


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dustin  
View profile  
 More options Aug 6 2009, 11:37 pm
From: Dustin <dsalli...@gmail.com>
Date: Thu, 6 Aug 2009 20:37:07 -0700 (PDT)
Local: Thurs, Aug 6 2009 11:37 pm
Subject: Re: Clobbering updates & CAS

On Aug 6, 6:26 am, Ren <Jared.Willi...@ntlworld.com> wrote:

> If the CAS operation succeeds, then its the currently running tasks
> responsibility to refresh the data in the cache, if it fails with
> RES_DATA_EXISTS, then someone else is taking care of the update.

  That's an interesting approach.  I'd only fear a failure to actually
update the value causing stale data to stick around longer than you'd
like.  Probably best to run those updates through your favorite job
queue.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ren  
View profile  
 More options Aug 7 2009, 7:00 am
From: Ren <Jared.Willi...@ntlworld.com>
Date: Fri, 7 Aug 2009 04:00:01 -0700 (PDT)
Local: Fri, Aug 7 2009 7:00 am
Subject: Re: Clobbering updates & CAS

On Aug 7, 4:37 am, Dustin <dsalli...@gmail.com> wrote:

> On Aug 6, 6:26 am, Ren <Jared.Willi...@ntlworld.com> wrote:

> > If the CAS operation succeeds, then its the currently running tasks
> > responsibility to refresh the data in the cache, if it fails with
> > RES_DATA_EXISTS, then someone else is taking care of the update.

>   That's an interesting approach.  I'd only fear a failure to actually
> update the value causing stale data to stick around longer than you'd
> like.  Probably best to run those updates through your favorite job
> queue.

Using a short (but long enough for the update to work in) TTL on the
CAS operation would cause the stale data to expire, sooner rather than
later.

But yes, a job queue would be more ideal.

Jared


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Sheldon  
View profile  
 More options Aug 10 2009, 11:26 am
From: David Sheldon <d...@earth.li>
Date: Mon, 10 Aug 2009 16:26:54 +0100
Local: Mon, Aug 10 2009 11:26 am
Subject: Re: Clobbering updates & CAS

On Fri, Aug 7, 2009 at 4:37 AM, Dustin<dsalli...@gmail.com> wrote:
> On Aug 6, 6:26 am, Ren <Jared.Willi...@ntlworld.com> wrote:
>> If the CAS operation succeeds, then its the currently running tasks
>> responsibility to refresh the data in the cache, if it fails with
>> RES_DATA_EXISTS, then someone else is taking care of the update.

>  That's an interesting approach.  I'd only fear a failure to actually
> update the value causing stale data to stick around longer than you'd
> like.  Probably best to run those updates through your favorite job
> queue.

I see this as a good idea. I think that the failure to update should be
on the step where it puts back the original data with the extended
expiry. If it cannot do this, then starting again will either read the
stale data with extended expiry, or updated data. Either way, that
thread will not update it.

Can you tell it not to use CAS (i.e. force the write) when it writes the
updated data with new expiry after regeneration? If so, then it's
unlikely that stale data will hang around longer.

David


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ren  
View profile  
 More options Aug 10 2009, 3:11 pm
From: Ren <Jared.Willi...@ntlworld.com>
Date: Mon, 10 Aug 2009 12:11:06 -0700 (PDT)
Local: Mon, Aug 10 2009 3:11 pm
Subject: Re: Clobbering updates & CAS

On Aug 10, 4:26 pm, David Sheldon <d...@earth.li> wrote:

If the CAS op succeeds and the thread doesn't follow it up with an
update later,
no other thread will update it. Until either the expiration value used
with the CAS
op, or the embedded expiration value passes.

> Can you tell it not to use CAS (i.e. force the write) when it writes the
> updated data with new expiry after regeneration? If so, then it's
> unlikely that stale data will hang around longer.

Just use a plain SET op.

Jared


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ren  
View profile  
 More options Aug 10 2009, 3:13 pm
From: Ren <Jared.Willi...@ntlworld.com>
Date: Mon, 10 Aug 2009 12:13:29 -0700 (PDT)
Local: Mon, Aug 10 2009 3:13 pm
Subject: Re: Clobbering updates & CAS

On Aug 10, 8:11 pm, Ren <Jared.Willi...@ntlworld.com> wrote:

Though, it would be nice if SET/CAS ops could return the new CAS
value, I think.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dustin  
View profile  
 More options Aug 12 2009, 1:10 am
From: Dustin <dsalli...@gmail.com>
Date: Tue, 11 Aug 2009 22:10:51 -0700 (PDT)
Local: Wed, Aug 12 2009 1:10 am
Subject: Re: Clobbering updates & CAS

On Aug 10, 12:13 pm, Ren <Jared.Willi...@ntlworld.com> wrote:

> Though, it would be nice if SET/CAS ops could return the new CAS
> value, I think.

  It does in the binary protocol.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ren  
View profile  
 More options Aug 12 2009, 8:39 am
From: Ren <Jared.Willi...@ntlworld.com>
Date: Wed, 12 Aug 2009 05:39:59 -0700 (PDT)
Local: Wed, Aug 12 2009 8:39 am
Subject: Re: Clobbering updates & CAS

On Aug 12, 6:10 am, Dustin <dsalli...@gmail.com> wrote:

> On Aug 10, 12:13 pm, Ren <Jared.Willi...@ntlworld.com> wrote:

> > Though, it would be nice if SET/CAS ops could return the new CAS
> > value, I think.

>   It does in the binary protocol.

Ah nice, well it seems PHP's PECL Memcached extension doesn't support
it.
Wether that is because libmemcached doesn't yet, don't know.

Jared


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dustin  
View profile  
 More options Aug 12 2009, 11:56 am
From: Dustin <dsalli...@gmail.com>
Date: Wed, 12 Aug 2009 08:56:35 -0700 (PDT)
Local: Wed, Aug 12 2009 11:56 am
Subject: Re: Clobbering updates & CAS

On Aug 12, 5:39 am, Ren <Jared.Willi...@ntlworld.com> wrote:

> Ah nice, well it seems PHP's PECL Memcached extension doesn't support
> it.
> Wether that is because libmemcached doesn't yet, don't know.

  libmemcached definitely does.  The bindings just need to be updated.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »