You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by Randall Leeds <ra...@gmail.com> on 2010/03/05 20:17:43 UTC
Opacity of Seq
Now seems like a good time to raise this issue:
Right now the replication code assumes sequence tokens from the source
are integers and I think this is wrong. It prevents replication from
the Lounge, but beyond my personal interest there it feels to me like
it should be an opaque token. It's necessary to know their arrival
order so that it's clear what the highest fully replicated seq is when
making checkpoints. Enumerating these tokens and zipping them in
tuples means they can be compared as before but without making
assumptions about the type of the tokens themselves.
Before I set about on the patch, how would people feel about a change
like this? The format of the actual checkpoint document won't change
(only the HighSeq calculations in the replication code and some
zipping/unzipping in places).
Randall
Re: Opacity of Seq
Posted by Randall Leeds <ra...@gmail.com>.
On Fri, Mar 5, 2010 at 11:49, J Chris Anderson <jc...@gmail.com> wrote:
> The same change may need to be accounted for in the view engine as well.
I don't think so, but I haven't written it yet.
For local databases we can make assumptions about the internals. Couch
stores seq tokens as integers, so we can treat them as integers when
looking at views. It's only when replicating that we can't make this
assumption.
Re: Opacity of Seq
Posted by J Chris Anderson <jc...@gmail.com>.
On Mar 5, 2010, at 11:26 AM, Adam Kocoloski wrote:
> On Mar 5, 2010, at 2:17 PM, Randall Leeds wrote:
>
>> Now seems like a good time to raise this issue:
>>
>> Right now the replication code assumes sequence tokens from the source
>> are integers and I think this is wrong. It prevents replication from
>> the Lounge, but beyond my personal interest there it feels to me like
>> it should be an opaque token. It's necessary to know their arrival
>> order so that it's clear what the highest fully replicated seq is when
>> making checkpoints. Enumerating these tokens and zipping them in
>> tuples means they can be compared as before but without making
>> assumptions about the type of the tokens themselves.
>>
>> Before I set about on the patch, how would people feel about a change
>> like this? The format of the actual checkpoint document won't change
>> (only the HighSeq calculations in the replication code and some
>> zipping/unzipping in places).
>>
>> Randall
>
> Absolutely, I didn't realize the replicator actually failed if the seqnum was not an integer. Preserving the arrival order of the tokens is a good thing. Best,
The same change may need to be accounted for in the view engine as well.
I'll wait to see the code before I have an opinion about suitability for 1.0
Chris
>
> Adam
>
Re: Opacity of Seq
Posted by Adam Kocoloski <ko...@apache.org>.
On Mar 5, 2010, at 2:17 PM, Randall Leeds wrote:
> Now seems like a good time to raise this issue:
>
> Right now the replication code assumes sequence tokens from the source
> are integers and I think this is wrong. It prevents replication from
> the Lounge, but beyond my personal interest there it feels to me like
> it should be an opaque token. It's necessary to know their arrival
> order so that it's clear what the highest fully replicated seq is when
> making checkpoints. Enumerating these tokens and zipping them in
> tuples means they can be compared as before but without making
> assumptions about the type of the tokens themselves.
>
> Before I set about on the patch, how would people feel about a change
> like this? The format of the actual checkpoint document won't change
> (only the HighSeq calculations in the replication code and some
> zipping/unzipping in places).
>
> Randall
Absolutely, I didn't realize the replicator actually failed if the seqnum was not an integer. Preserving the arrival order of the tokens is a good thing. Best,
Adam