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
TTL command return value change
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
  4 messages - Collapse 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
 
Salvatore Sanfilippo  
View profile  
 More options Nov 10 2012, 6:48 am
From: Salvatore Sanfilippo <anti...@gmail.com>
Date: Sat, 10 Nov 2012 12:47:35 +0100
Local: Sat, Nov 10 2012 6:47 am
Subject: TTL command return value change
Hi list,

currently the TTL command returns -1 on non existing key, and also in
the case no expire time is set on the key at all.

Starting with Redis 2.8 I would like to change the behavior into the following:

Key without TTL -> -1
Non existing key TTL -> -2

I don't think this is going to break a lot of code at all, but I
wonder what you think. This API makes sense as to have the old
behavior you need just:

if ttl(key) < 0, instead of explicitly checking for -1

Instead in order to distinguish the two other different cases, just
check for the proper value, that your client library could declare as
constants for simplicity.

About the sequence -1 and -2, the rationale is that -1 no TTL and -2
no key at all is in accordance with the fact that -2 feels "more
negative" than -1, so it is easy to remember.

Cheers,
Salvatore

--
Salvatore 'antirez' Sanfilippo
open source developer - VMware
http://invece.org

Beauty is more important in computing than anywhere else in technology
because software is so complicated. Beauty is the ultimate defence
against complexity.
       — David Gelernter


 
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.
Sergei Tulentsev  
View profile  
 More options Nov 10 2012, 9:52 am
From: Sergei Tulentsev <sergei.tulent...@gmail.com>
Date: Sat, 10 Nov 2012 18:52:27 +0400
Local: Sat, Nov 10 2012 9:52 am
Subject: Re: TTL command return value change

This won't break any of my code. And it seems like a good idea. :)

On Sat, Nov 10, 2012 at 3:47 PM, Salvatore Sanfilippo <anti...@gmail.com>wrote:

--
Best regards,
Sergei Tulentsev

 
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.
Hikeonpast  
View profile  
 More options Nov 12 2012, 1:11 pm
From: Hikeonpast <deanwba...@gmail.com>
Date: Mon, 12 Nov 2012 10:11:45 -0800 (PST)
Local: Mon, Nov 12 2012 1:11 pm
Subject: Re: TTL command return value change

This would be awesome.  We end up pipelining EXISTS and TTL on a bunch of
reads to work around the current limitation.  Your proposed implementation
is great from our perspective.

Is there any chance that this might be back-ported to 2.6? :)

Cheers,

Dean


 
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.
Salvatore Sanfilippo  
View profile  
 More options Nov 12 2012, 1:53 pm
From: Salvatore Sanfilippo <anti...@gmail.com>
Date: Mon, 12 Nov 2012 19:52:46 +0100
Local: Mon, Nov 12 2012 1:52 pm
Subject: Re: TTL command return value change

On Mon, Nov 12, 2012 at 7:11 PM, Hikeonpast <deanwba...@gmail.com> wrote:
> Is there any chance that this might be back-ported to 2.6? :)

Sorry we can't break 2.6 API... but the change is in line for 2.8 :-)

Salvatore

--
Salvatore 'antirez' Sanfilippo
open source developer - VMware
http://invece.org

Beauty is more important in computing than anywhere else in technology
because software is so complicated. Beauty is the ultimate defence
against complexity.
       — David Gelernter


 
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 »