Invalidated resources with memcache implementation

View: New views
5 Messages — Rating Filter:   Alert me  

Invalidated resources with memcache implementation

by Eli Bach :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

When using open directory configure users/groups/locations/resources,  
with the new memcached caching implementation, what is the best way to  
handle the situation where

-a user tries to invite a specific user email address in iCal, but the  
user isn't present is OD
-so DCS adds that email address to the cache as being invalid
-the user adds the user to OD
-the user goes back to iCal to re-invite the user

At this point, DCS seems to only use the cache entry, which still  
indicates the address is invalid.

What should be done at this point?

I've got a separate process that helps manage changes to the server,  
so I could send a signal to DCS or possibly to the memcached process,  
but what is the best way to handle this?  Of course, the trivial, but  
extremely heavyweight option is to restart DCS.

Eli

_______________________________________________
calendarserver-dev mailing list
calendarserver-dev@...
http://lists.macosforge.org/mailman/listinfo.cgi/calendarserver-dev

Re: Invalidated resources with memcache implementation

by Wilfredo Sánchez Vega :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

   The caches should time out such that eventually the new email  
address is recognized, but there will be some time when the server has  
stale data.

   There is no way to get notified by OD that a record changed, so the  
only other option is not to cache the data.

   If an hour later (I think the cache timeout is 30 minute), you  
still can't use that email address, we probably have a bug.

        -wsv


On May 6, 2009, at 12:48 PM, Eli Bach wrote:

> When using open directory configure users/groups/locations/
> resources, with the new memcached caching implementation, what is  
> the best way to handle the situation where
>
> -a user tries to invite a specific user email address in iCal, but  
> the user isn't present is OD
> -so DCS adds that email address to the cache as being invalid
> -the user adds the user to OD
> -the user goes back to iCal to re-invite the user
>
> At this point, DCS seems to only use the cache entry, which still  
> indicates the address is invalid.
>
> What should be done at this point?
>
> I've got a separate process that helps manage changes to the server,  
> so I could send a signal to DCS or possibly to the memcached  
> process, but what is the best way to handle this?  Of course, the  
> trivial, but extremely heavyweight option is to restart DCS.

_______________________________________________
calendarserver-dev mailing list
calendarserver-dev@...
http://lists.macosforge.org/mailman/listinfo.cgi/calendarserver-dev

Re: Invalidated resources with memcache implementation

by Eli Bach :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On May 15, 2009, at 3:29 PM, Wilfredo Sánchez Vega wrote:

>  The caches should time out such that eventually the new email  
> address is recognized, but there will be some time when the server  
> has stale data.
>
>  There is no way to get notified by OD that a record changed, so the  
> only other option is not to cache the data.
>
>  If an hour later (I think the cache timeout is 30 minute), you  
> still can't use that email address, we probably have a bug.
>
> -wsv
>
>
> On May 6, 2009, at 12:48 PM, Eli Bach wrote:
>
>> When using open directory configure users/groups/locations/
>> resources, with the new memcached caching implementation, what is  
>> the best way to handle the situation where
>>
>> -a user tries to invite a specific user email address in iCal, but  
>> the user isn't present is OD
>> -so DCS adds that email address to the cache as being invalid
>> -the user adds the user to OD
>> -the user goes back to iCal to re-invite the user
>>
>> At this point, DCS seems to only use the cache entry, which still  
>> indicates the address is invalid.
>>
>> What should be done at this point?
>>
>> I've got a separate process that helps manage changes to the  
>> server, so I could send a signal to DCS or possibly to the  
>> memcached process, but what is the best way to handle this?  Of  
>> course, the trivial, but extremely heavyweight option is to restart  
>> DCS.

Is there a better way to do this, other than to tell the user to wait  
30 minutes?

There's:

1) restart the whole DCS server
2) get the memcached to empty itself of all cached entries
3) get the memcached to empty itself of just the cached entries  
related to modified entries (either added, removed or modified)

I'll probably look at doing 2, as doing 3 requires matching exactly  
how DCS caches each bit of data, as well as need both the original and  
the updated values for all the entries that DCS uses to handle it  
properly.

Eli

_______________________________________________
calendarserver-dev mailing list
calendarserver-dev@...
http://lists.macosforge.org/mailman/listinfo.cgi/calendarserver-dev

Re: Invalidated resources with memcache implementation

by Wilfredo Sánchez Vega :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On May 15, 2009, at 6:07 PM, Eli Bach wrote:

> Is there a better way to do this, other than to tell the user to  
> wait 30 minutes?
>
> There's:
>
> 1) restart the whole DCS server
> 2) get the memcached to empty itself of all cached entries
> 3) get the memcached to empty itself of just the cached entries  
> related to modified entries (either added, removed or modified)
>
> I'll probably look at doing 2, as doing 3 requires matching exactly  
> how DCS caches each bit of data, as well as need both the original  
> and the updated values for all the entries that DCS uses to handle  
> it properly.

   You can lower the "cacheTimeout" value in the config file from 30  
some something shorter, if the performance of that isn't a problem for  
you.  Shouldn't be if you aren't serving oodles of users.

        -wsv

_______________________________________________
calendarserver-dev mailing list
calendarserver-dev@...
http://lists.macosforge.org/mailman/listinfo.cgi/calendarserver-dev

Re: Invalidated resources with memcache implementation

by SteveSto :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Try the Memcached distro from Gear6 - I believe they have solved this problem.

Wilfredo Sánchez Vega wrote:
On May 15, 2009, at 6:07 PM, Eli Bach wrote:

> Is there a better way to do this, other than to tell the user to  
> wait 30 minutes?
>
> There's:
>
> 1) restart the whole DCS server
> 2) get the memcached to empty itself of all cached entries
> 3) get the memcached to empty itself of just the cached entries  
> related to modified entries (either added, removed or modified)
>
> I'll probably look at doing 2, as doing 3 requires matching exactly  
> how DCS caches each bit of data, as well as need both the original  
> and the updated values for all the entries that DCS uses to handle  
> it properly.

   You can lower the "cacheTimeout" value in the config file from 30  
some something shorter, if the performance of that isn't a problem for  
you.  Shouldn't be if you aren't serving oodles of users.

        -wsv

_______________________________________________
calendarserver-dev mailing list
calendarserver-dev@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/calendarserver-dev