You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Lena Herrmann <le...@zeromail.org> on 2010/01/04 15:34:44 UTC

Turning continuous replication back on

Hi,

let's say I have a continuous replication running from a "client" to a 
"server", so that changes on the client are replicated to the server. 
When the server goes offline, I understand that the client tries to 
replicate every second, then every 2 seconds, every 4, 8, 16 and so on.

My question: Is there a way to turn the continuous replication back on 
in my JS application on the client? For example, checking every X 
seconds with setTimeout if I can load something from the server, and 
when the server is there again, I'd like to tell the client's continuous 
replication to go back to very small timeouts between attempts.

Thanks in advance

Lena

Re: Turning continuous replication back on

Posted by Adam Kocoloski <ko...@apache.org>.
On Jan 4, 2010, at 12:57 PM, Chris Anderson wrote:

> On Mon, Jan 4, 2010 at 6:34 AM, Lena Herrmann <le...@zeromail.org> wrote:
>> Hi,
>> 
>> let's say I have a continuous replication running from a "client" to a
>> "server", so that changes on the client are replicated to the server. When
>> the server goes offline, I understand that the client tries to replicate
>> every second, then every 2 seconds, every 4, 8, 16 and so on.
>> 
>> My question: Is there a way to turn the continuous replication back on in my
>> JS application on the client? For example, checking every X seconds with
>> setTimeout if I can load something from the server, and when the server is
>> there again, I'd like to tell the client's continuous replication to go back
>> to very small timeouts between attempts.
> 
> I haven't tried it, but the first thing I'd try is just triggered
> another continuous replication. It certainly won't hurt, and it might
> be just what you're looking for.
> 
> This brings to mind that we'd do well to have the continuous
> replication configuration stored somewhere that's not voodoo. Like in
> a database, so you could just edit a document to refresh it.
> 
> Adam, any thoughts on this?

Yeah, we're overdue for a replication configuration DB.  There's an old thread on dev@ that fleshes out the design fairly well.  When that feature is available, refreshing the config doc would reboot the replication from the last checkpoint, and reset the timeout in the process.

At the moment, I don't believe there is a way to reset the timeout of a continuous replication.  The timeout interval should reset when the replication wakes up and successfully resumes operations, though.  Best,

Adam


Re: Turning continuous replication back on

Posted by Chris Anderson <jc...@apache.org>.
On Mon, Jan 4, 2010 at 6:34 AM, Lena Herrmann <le...@zeromail.org> wrote:
> Hi,
>
> let's say I have a continuous replication running from a "client" to a
> "server", so that changes on the client are replicated to the server. When
> the server goes offline, I understand that the client tries to replicate
> every second, then every 2 seconds, every 4, 8, 16 and so on.
>
> My question: Is there a way to turn the continuous replication back on in my
> JS application on the client? For example, checking every X seconds with
> setTimeout if I can load something from the server, and when the server is
> there again, I'd like to tell the client's continuous replication to go back
> to very small timeouts between attempts.

I haven't tried it, but the first thing I'd try is just triggered
another continuous replication. It certainly won't hurt, and it might
be just what you're looking for.

This brings to mind that we'd do well to have the continuous
replication configuration stored somewhere that's not voodoo. Like in
a database, so you could just edit a document to refresh it.

Adam, any thoughts on this?

>
> Thanks in advance
>
> Lena
>



-- 
Chris Anderson
http://jchrisa.net
http://couch.io