Re: [Tzdist] Ticket #22

Cyrus Daboo <cyrus@daboo.name> Thu, 28 August 2014 14:16 UTC

Return-Path: <cyrus@daboo.name>
X-Original-To: tzdist@ietfa.amsl.com
Delivered-To: tzdist@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 062531A069D for <tzdist@ietfa.amsl.com>; Thu, 28 Aug 2014 07:16:57 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.669
X-Spam-Level:
X-Spam-Status: No, score=-0.669 tagged_above=-999 required=5 tests=[BAYES_40=-0.001, RP_MATCHES_RCVD=-0.668] autolearn=ham
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id M2zrn8cxpDIe for <tzdist@ietfa.amsl.com>; Thu, 28 Aug 2014 07:16:55 -0700 (PDT)
Received: from daboo.name (daboo.name [173.13.55.49]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id CAA121A0688 for <tzdist@ietf.org>; Thu, 28 Aug 2014 07:16:53 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1]) by daboo.name (Postfix) with ESMTP id 783F176145A; Thu, 28 Aug 2014 10:12:22 -0400 (EDT)
X-Virus-Scanned: amavisd-new at example.com
Received: from daboo.name ([127.0.0.1]) by localhost (daboo.name [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xMPkAYUutbhp; Thu, 28 Aug 2014 10:12:20 -0400 (EDT)
Received: from caldav.corp.apple.com (unknown [17.45.162.46]) by daboo.name (Postfix) with ESMTPSA id B934F761449; Thu, 28 Aug 2014 10:12:19 -0400 (EDT)
Date: Thu, 28 Aug 2014 10:16:45 -0400
From: Cyrus Daboo <cyrus@daboo.name>
To: Lester Caine <lester@lsces.co.uk>, tzdist@ietf.org
Message-ID: <EF49B4409B8CFD53FCD254F0@caldav.corp.apple.com>
In-Reply-To: <53FE0A55.1090206@lsces.co.uk>
References: <53FDC7C7.5090601@andrew.cmu.edu> <53FDCC59.5030709@lsces.co.uk> <53FDD001.1030509@andrew.cmu.edu> <53FDD6AB.2040108@lsces.co.uk> <1A53EA915BFC18CE7032D937@caldav.corp.apple.com> <53FDEC6D.7010700@lsces.co.uk> <2C63A61739282D507903E4C7@caldav.corp.apple.com> <53FE0A55.1090206@lsces.co.uk>
X-Mailer: Mulberry/4.1.0b1 (Mac OS X)
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"; format="flowed"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; size="4424"
Archived-At: http://mailarchive.ietf.org/arch/msg/tzdist/USvD_YzijaHuXc96tcgYRseH6oU
Subject: Re: [Tzdist] Ticket #22
X-BeenThere: tzdist@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <tzdist.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/tzdist>, <mailto:tzdist-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/tzdist/>
List-Post: <mailto:tzdist@ietf.org>
List-Help: <mailto:tzdist-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/tzdist>, <mailto:tzdist-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 28 Aug 2014 14:16:57 -0000

Hi Lester,

--On August 27, 2014 at 5:41:57 PM +0100 Lester Caine <lester@lsces.co.uk> 
wrote:

> OK this is filling in my mistakes ... I'd not considered relying only on
> the ETag caching given the qualification on it's use in the get
> definition? Re-reading it of cause , there SHOULD only be one timezone
> specified so under what condition would it not?

I think that text is left over from a time when we allowed multiple time 
zones to be returned in a single GET, but we later decided that was 
overkill and broke HTTP caching to an extent we were uncomfortable with. I 
will fix that text.

> I'm more used to data replication which is transactional. I'm normally
> doing all of this in databases. It's just different mindsets. I would
> just be replicating the change rather than resending the whole data
> package. But we are not reliant on a single data source which is what
> ETag is enforcing? Having said that, since the data IS well defined why
> would the generated ETag values be different between servers?

ETags are opaque tokens generated by the HTTP server. There is no 
requirement that different servers use the same method to generate those - 
some may choose an md5 hash, others sha1, and others something completely 
different. So ETags are not meant to represent state across servers - they 
only represent the state of the one resource they are "attached" to.

> The race condition I'm more concerned about here is that of a secondary
> server, but rethinking things, it's more a case here of what is used to
> feed that servers clients? While the server is downloading and
> processing each new get, what is it's response to it's clients? Is each
> new change used as it's downloaded, and IT'S list package changed each
> time, or as I proposed previously does the whole update get processed
> and then made active .. as I would expect the distributor to be doing.
>
> I can see now why you may have such a diverse spread of versions while
> I'm looking to maintain data that is NOT necessarily being used on the
> same machine that the normalizing has been processed on so I NEED a
> stable version identity for other machines to work with! I need
> something that can be stored with the archived data and verified later,
> which is what a properly managed last-modified provides.

By choosing to allow individual time zones to be downloaded, as opposed to 
the entire database all in one go, we do introduce the possibility of race 
conditions. In the case of a secondary server replicating what is on a 
primary, the secondary can achieve some level of integrity by using 
action=list&changedsince,action=get operations up to a point where the 
list+changedsince returns no results.

As far as clients go, they too are subject to this race - they too could 
repeat a list+changedsince immediately after doing a list/get sync to 
verify they have the latest.

>> Now, I do think the current draft is lacking in discussion of the
>> ETag-condition action=get behavior, and I propose adding text to Section
>> 6.3 to cover that. I would also be willing to add a (non-mormative)
>> appendix describing an example client sync procedure such as the one I
>> outlined above, but I really want it to be in the most general of terms
>> because client implementors really need to think carefully about that
>> themselves.
>
> This is not exactly obvious to a new reader :(
> My own experience of caching can be somewhat hit and miss as the routing
> and data proxies change. We have to design the mobile applications
> around here so they work reliably off-net until a mobile connection can
> be restored, and I'm not yet convinced that ETag can work in that
> situation? A local database/webserver maintains operation until it can
> replicate that back to the main service.

ETag together with list+changedsince is the equivalent of what we do in 
CalDAV - there clients also use ETag together with the webdav sync REPORT 
to cache data from the server. Those client are all capable of working in 
an offline mode - and in fact a more complex mode in that changes made on 
the client whilst disconnected need to be sync'd up to the server when they 
re-connect, i.e., a two-way sync is involved. So I am confident what we 
have now is sufficient for a one-way sync from primary to secondary or 
server to client, though I am not confident I have convinced you of that 
fact yet :-)

-- 
Cyrus Daboo