Also helpful if we have a detailed API documentation with error codes?
Trying to read this but not so sure if I got it right
https://github.com/memcached/memcached/wiki/BinaryProtocolRevamped
On Friday, June 24, 2016 at 10:28:41 PM UTC+5:30, Nishant Varma wrote:
>
> Right, Thanks for clar
after a failing add, because if you read the
> value, it was missing and the add fails (with the "already exist" error
> code) it means the key was set in the meantime.
> So you can read the value and make a cas to update it.
>
> Hope it helps
>
> 2016-06-24 14:12 GM
http://neopythonic.blogspot.in/2011/08/compare-and-set-in-memcache.html,
GVR talks about a use case of a simple counter.
Generalizing that, 1) would it be fine to say you could use CAS when you
need to modifying the data according to the latest state? For example
counter, appending a list,
out your time. There is no hurry on this like I said
I voluntarily trying to make it a bit better.
Thanks,
Nishant
On Wednesday, June 8, 2016 at 11:58:00 PM UTC+5:30, Dormando wrote:
>
>
>
> On Tue, 7 Jun 2016, Nishant Varma wrote:
>
> > There was too much noise re
> if (memcli:add(key . "_lock", lock_timeout_time, my_admin_username)) {
> [etc]
> } else {
> # lost the race, handle how you want
> }
> } else if (item.value == my_admin_username) {
> # good to go for that future request
> }
>
> Then when you're do
print "Being processed by %s" % user
else:
# But lost the race to find that.
print "Processed by another user."
def process(source):
shutil.move(source, destination)
# filename => source
memcache.delete(filename)
On Monday,
filename => source
memcache.delete(filename)
On Monday, June 6, 2016 at 7:07:21 PM UTC+5:30, Nishant Varma wrote:
>
> Enhanced it a bit to to check if the file is really present as well before
> I proceed ... Btw this has to be done after obtaining the lock otherwise
> agai
:
return "Processed by another user."
else:
user = memcache.get(filename)
return "%s is Processing" % user
I guess this should cover our scenario. Do you have any thoughts?
On Monday, June 6, 2016 at 5:20:28 PM UTC+5:30, Nishant
eed any more complication in my scenario?
Would help if you can clarify. Thanks.
Thanks,
Nishant
On Saturday, June 4, 2016 at 7:04:58 PM UTC+5:30, Nishant Varma wrote:
>
> I am reading
> https://github.com/memcached/memcached/wiki/ProgrammingTricks#ghetto-central-locking,
&
am sorry if I am
repeating this, but I could not really relate the "fetching expensive item
from Database" to my scenario which is why I even wrote a simple script to
test the validity of the claim etc.
Can you please let me know?
On Saturday, June 4, 2016 at 6:42:35 PM UTC+5:30, N
seudocode in
> the link I gave you several times in the issue. Please use it.
>
> Thanks,
> -Dormando
>
> On Fri, 3 Jun 2016, Nishant Varma wrote:
>
> > Can anyone help me peer review this script
> https://gist.github.com/varmanishant/0129286d41038cc21471652a6460a5
data you need, however I insist *again* that you're
> overengineering this.
>
> On Sat, 4 Jun 2016, Nishant Varma wrote:
>
> > Real time of offline solutions would be helpful. If I can profile in
> background and query it later that is one option. However the only co
:13:32 PM UTC+5:30, Nishant Varma wrote:
>
> I am trying to troubleshoot an issue which could happen because of get-set
> race condition. I can monitor the entire memcache operations but I guess it
> is going to be huge because its a small percentage of the DB itself, so I
> need
I am trying to troubleshoot an issue which could happen because of get-set
race condition. I can monitor the entire memcache operations but I guess it
is going to be huge because its a small percentage of the DB itself, so I
need to filter only the keys I am interested in. We have a namespacing
Can anyone help me peer review this script
https://gist.github.com/varmanishant/0129286d41038cc21471652a6460a5ff that
demonstrate potential problems with get set if it is used to implement
distributed locking. I was suggested to modify from get set to add in this
thread
15 matches
Mail list logo