You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "Till Klampaeckel (JIRA)" <ji...@apache.org> on 2010/06/02 18:03:37 UTC

[jira] Created: (COUCHDB-782) Restarting replication

Restarting replication 
-----------------------

                 Key: COUCHDB-782
                 URL: https://issues.apache.org/jira/browse/COUCHDB-782
             Project: CouchDB
          Issue Type: Bug
          Components: Replication
    Affects Versions: 0.10
         Environment: Ubuntu, 9.10
            Reporter: Till Klampaeckel


So we had to restart replication on a server and here's something I noticed.

At first I restarted the replication via the following command from localhost:

curl -X POST -d '{"source":"http://localhost:5984/foo", "target":"http://remote:5984/foo"}' http://localhost:5984/_replicate

In response, futon stats:
W Processed source update #176841152

That part is great.

Last night I did not have immediate access to the shell so I restarted replication from remote:

curl -X POST -d '{"source":"http://user:pass@public.host:5984/foo", "target":"http://remote:5984/foo"}' http://user:pass@pubic.host:5984/_replicate

The response in futon this morning:
W Processed source update #1066

... and it kept sitting there like it was stalled and only continue in smaller increments.

I restarted CouchDB and restarted from localhost - instant jump to 176 million.

I'm just wondering what might be different accept for that one is against the public interface, vs. localhost. I'd assume that replication behaves the same regardless.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-782) Restarting replication

Posted by "Till Klampaeckel (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-782?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12874666#action_12874666 ] 

Till Klampaeckel commented on COUCHDB-782:
------------------------------------------

I guess I agree that it's important.

This is probably not an issue for installs on a smaller scale but gets annoying when you're in for "moar".

> Restarting replication 
> -----------------------
>
>                 Key: COUCHDB-782
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-782
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Replication
>    Affects Versions: 0.10
>         Environment: Ubuntu, 9.10
>            Reporter: Till Klampaeckel
>
> So we had to restart replication on a server and here's something I noticed.
> At first I restarted the replication via the following command from localhost:
> curl -X POST -d '{"source":"http://localhost:5984/foo", "target":"http://remote:5984/foo"}' http://localhost:5984/_replicate
> In response, futon stats:
> W Processed source update #176841152
> That part is great.
> Last night I did not have immediate access to the shell so I restarted replication from remote (through curl on my mobile):
> curl -X POST -d '{"source":"http://user:pass@public.host:5984/foo", "target":"http://remote:5984/foo"}' http://user:pass@pubic.host:5984/_replicate
> The response in futon this morning:
> W Processed source update #1066
> ... and it kept sitting there like it was stalled and only continued in smaller increments.
> I restarted CouchDB and restarted from localhost - instant jump to 176 million.
> I'm just wondering what might be different accept for that one is against the public interface, vs. localhost. I'd assume that replication behaves the same regardless.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (COUCHDB-782) Restarting replication

Posted by "Till Klampaeckel (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-782?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Till Klampaeckel updated COUCHDB-782:
-------------------------------------

    Description: 
So we had to restart replication on a server and here's something I noticed.

At first I restarted the replication via the following command from localhost:

curl -X POST -d '{"source":"http://localhost:5984/foo", "target":"http://remote:5984/foo"}' http://localhost:5984/_replicate

In response, futon stats:
W Processed source update #176841152

That part is great.

Last night I did not have immediate access to the shell so I restarted replication from remote (through curl on my mobile):

curl -X POST -d '{"source":"http://user:pass@public.host:5984/foo", "target":"http://remote:5984/foo"}' http://user:pass@pubic.host:5984/_replicate

The response in futon this morning:
W Processed source update #1066

... and it kept sitting there like it was stalled and only continued in smaller increments.

I restarted CouchDB and restarted from localhost - instant jump to 176 million.

I'm just wondering what might be different accept for that one is against the public interface, vs. localhost. I'd assume that replication behaves the same regardless.

  was:
So we had to restart replication on a server and here's something I noticed.

At first I restarted the replication via the following command from localhost:

curl -X POST -d '{"source":"http://localhost:5984/foo", "target":"http://remote:5984/foo"}' http://localhost:5984/_replicate

In response, futon stats:
W Processed source update #176841152

That part is great.

Last night I did not have immediate access to the shell so I restarted replication from remote:

curl -X POST -d '{"source":"http://user:pass@public.host:5984/foo", "target":"http://remote:5984/foo"}' http://user:pass@pubic.host:5984/_replicate

The response in futon this morning:
W Processed source update #1066

... and it kept sitting there like it was stalled and only continue in smaller increments.

I restarted CouchDB and restarted from localhost - instant jump to 176 million.

I'm just wondering what might be different accept for that one is against the public interface, vs. localhost. I'd assume that replication behaves the same regardless.


Spelling!

> Restarting replication 
> -----------------------
>
>                 Key: COUCHDB-782
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-782
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Replication
>    Affects Versions: 0.10
>         Environment: Ubuntu, 9.10
>            Reporter: Till Klampaeckel
>
> So we had to restart replication on a server and here's something I noticed.
> At first I restarted the replication via the following command from localhost:
> curl -X POST -d '{"source":"http://localhost:5984/foo", "target":"http://remote:5984/foo"}' http://localhost:5984/_replicate
> In response, futon stats:
> W Processed source update #176841152
> That part is great.
> Last night I did not have immediate access to the shell so I restarted replication from remote (through curl on my mobile):
> curl -X POST -d '{"source":"http://user:pass@public.host:5984/foo", "target":"http://remote:5984/foo"}' http://user:pass@pubic.host:5984/_replicate
> The response in futon this morning:
> W Processed source update #1066
> ... and it kept sitting there like it was stalled and only continued in smaller increments.
> I restarted CouchDB and restarted from localhost - instant jump to 176 million.
> I'm just wondering what might be different accept for that one is against the public interface, vs. localhost. I'd assume that replication behaves the same regardless.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-782) Restarting replication

Posted by "Randall Leeds (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-782?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12874659#action_12874659 ] 

Randall Leeds commented on COUCHDB-782:
---------------------------------------

I've run into this problem, too. Couch uses the URI of the source and destination to determine the id for the document which stores replication checkpoints. A while back I proposed adding a uuid to each database that does not get replicated and could uniquely identify each replica. No one seemed to think this was important enough, but I'd be happy to do the work.

> Restarting replication 
> -----------------------
>
>                 Key: COUCHDB-782
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-782
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Replication
>    Affects Versions: 0.10
>         Environment: Ubuntu, 9.10
>            Reporter: Till Klampaeckel
>
> So we had to restart replication on a server and here's something I noticed.
> At first I restarted the replication via the following command from localhost:
> curl -X POST -d '{"source":"http://localhost:5984/foo", "target":"http://remote:5984/foo"}' http://localhost:5984/_replicate
> In response, futon stats:
> W Processed source update #176841152
> That part is great.
> Last night I did not have immediate access to the shell so I restarted replication from remote (through curl on my mobile):
> curl -X POST -d '{"source":"http://user:pass@public.host:5984/foo", "target":"http://remote:5984/foo"}' http://user:pass@pubic.host:5984/_replicate
> The response in futon this morning:
> W Processed source update #1066
> ... and it kept sitting there like it was stalled and only continued in smaller increments.
> I restarted CouchDB and restarted from localhost - instant jump to 176 million.
> I'm just wondering what might be different accept for that one is against the public interface, vs. localhost. I'd assume that replication behaves the same regardless.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-782) Restarting replication

Posted by "Randall Leeds (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-782?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12875204#action_12875204 ] 

Randall Leeds commented on COUCHDB-782:
---------------------------------------

Damien, I originally reasoned that this was a good thing because the identity of a database would follow the database itself. I now realize that while this is great for moving dbs it's a disaster for copying them because you create two (possibly diverging) instances which claim to be the same.

Regarding a canonical format, how does this simple idea sound:
Generate a random uuid on the #db record, but do not write it out in the header. This way, dbs have a new uuid every time they're opened. Then, the replicator can try to open the bare db name at the end of the URI locally and compare that to the uuid returned from the http info. Then, local dbs can be detected and canonicalized to the bare db name without relying on hostname information that is sensitive to system/dns configuration problems.

As a side bonus, replicating a database to itself could *always* be detected at the outset, which reduces the checkpoint conflict scenarios to only ones in which a previous checkpoint save succeeded but the client timed out waiting for the reply, at which point replication should safely restart gracefully. I'm happy to put this together later.

> Restarting replication 
> -----------------------
>
>                 Key: COUCHDB-782
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-782
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Replication
>    Affects Versions: 0.10
>         Environment: Ubuntu, 9.10
>            Reporter: Till Klampaeckel
>
> So we had to restart replication on a server and here's something I noticed.
> At first I restarted the replication via the following command from localhost:
> curl -X POST -d '{"source":"http://localhost:5984/foo", "target":"http://remote:5984/foo"}' http://localhost:5984/_replicate
> In response, futon stats:
> W Processed source update #176841152
> That part is great.
> Last night I did not have immediate access to the shell so I restarted replication from remote (through curl on my mobile):
> curl -X POST -d '{"source":"http://user:pass@public.host:5984/foo", "target":"http://remote:5984/foo"}' http://user:pass@pubic.host:5984/_replicate
> The response in futon this morning:
> W Processed source update #1066
> ... and it kept sitting there like it was stalled and only continued in smaller increments.
> I restarted CouchDB and restarted from localhost - instant jump to 176 million.
> I'm just wondering what might be different accept for that one is against the public interface, vs. localhost. I'd assume that replication behaves the same regardless.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-782) Restarting replication

Posted by "Damien Katz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-782?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12875190#action_12875190 ] 

Damien Katz commented on COUCHDB-782:
-------------------------------------

Per database UUIDs have the problem of databases being copied around on the file system, or restored from backup. A better option is convert the URIs to a canonical format so they always look the same.

> Restarting replication 
> -----------------------
>
>                 Key: COUCHDB-782
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-782
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Replication
>    Affects Versions: 0.10
>         Environment: Ubuntu, 9.10
>            Reporter: Till Klampaeckel
>
> So we had to restart replication on a server and here's something I noticed.
> At first I restarted the replication via the following command from localhost:
> curl -X POST -d '{"source":"http://localhost:5984/foo", "target":"http://remote:5984/foo"}' http://localhost:5984/_replicate
> In response, futon stats:
> W Processed source update #176841152
> That part is great.
> Last night I did not have immediate access to the shell so I restarted replication from remote (through curl on my mobile):
> curl -X POST -d '{"source":"http://user:pass@public.host:5984/foo", "target":"http://remote:5984/foo"}' http://user:pass@pubic.host:5984/_replicate
> The response in futon this morning:
> W Processed source update #1066
> ... and it kept sitting there like it was stalled and only continued in smaller increments.
> I restarted CouchDB and restarted from localhost - instant jump to 176 million.
> I'm just wondering what might be different accept for that one is against the public interface, vs. localhost. I'd assume that replication behaves the same regardless.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (COUCHDB-782) Restarting replication

Posted by "Paul Joseph Davis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-782?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul Joseph Davis updated COUCHDB-782:
--------------------------------------

    Skill Level: Regular Contributors Level (Easy to Medium)

> Restarting replication 
> -----------------------
>
>                 Key: COUCHDB-782
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-782
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Replication
>    Affects Versions: 0.10
>         Environment: Ubuntu, 9.10
>            Reporter: Till Klampaeckel
>
> So we had to restart replication on a server and here's something I noticed.
> At first I restarted the replication via the following command from localhost:
> curl -X POST -d '{"source":"http://localhost:5984/foo", "target":"http://remote:5984/foo"}' http://localhost:5984/_replicate
> In response, futon stats:
> W Processed source update #176841152
> That part is great.
> Last night I did not have immediate access to the shell so I restarted replication from remote (through curl on my mobile):
> curl -X POST -d '{"source":"http://user:pass@public.host:5984/foo", "target":"http://remote:5984/foo"}' http://user:pass@pubic.host:5984/_replicate
> The response in futon this morning:
> W Processed source update #1066
> ... and it kept sitting there like it was stalled and only continued in smaller increments.
> I restarted CouchDB and restarted from localhost - instant jump to 176 million.
> I'm just wondering what might be different accept for that one is against the public interface, vs. localhost. I'd assume that replication behaves the same regardless.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-782) Restarting replication

Posted by "Till Klampaeckel (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-782?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12875159#action_12875159 ] 

Till Klampaeckel commented on COUCHDB-782:
------------------------------------------

Until I find time for the wiki:

The mechanism does not just depend on the host per se, all the following URIs are different to CouchDB even though they point to the same system:

 http://foo:bar@localhost:5984/citations
 http://localhost:5984/citations
 

@Randall
While you're at it doing UUIDs for databases, do you think it would be possible to do a UUID for a server as well? It could be exposed with the version. It would be very useful in large scale setups for monitoring etc.. E.g. to easily tell shards apart, etc.. Vs. building external "logic" that revolves around hostnames, port numbers or different something.

> Restarting replication 
> -----------------------
>
>                 Key: COUCHDB-782
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-782
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Replication
>    Affects Versions: 0.10
>         Environment: Ubuntu, 9.10
>            Reporter: Till Klampaeckel
>
> So we had to restart replication on a server and here's something I noticed.
> At first I restarted the replication via the following command from localhost:
> curl -X POST -d '{"source":"http://localhost:5984/foo", "target":"http://remote:5984/foo"}' http://localhost:5984/_replicate
> In response, futon stats:
> W Processed source update #176841152
> That part is great.
> Last night I did not have immediate access to the shell so I restarted replication from remote (through curl on my mobile):
> curl -X POST -d '{"source":"http://user:pass@public.host:5984/foo", "target":"http://remote:5984/foo"}' http://user:pass@pubic.host:5984/_replicate
> The response in futon this morning:
> W Processed source update #1066
> ... and it kept sitting there like it was stalled and only continued in smaller increments.
> I restarted CouchDB and restarted from localhost - instant jump to 176 million.
> I'm just wondering what might be different accept for that one is against the public interface, vs. localhost. I'd assume that replication behaves the same regardless.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-782) Restarting replication

Posted by "Randall Leeds (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-782?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12875207#action_12875207 ] 

Randall Leeds commented on COUCHDB-782:
---------------------------------------

As far as a canonical format for remote databases:
1) strip the protocol so http and https aren't different
2) strip any login info
3) strip trailing slashes
4) uri-decode the result (I say decode only because I'm relatively sure it's idempotent, but I don't know if encoding is. In particular, is % safe in a uri?)

Care would have to be taken to check for and migrate old checkpoint histories.

> Restarting replication 
> -----------------------
>
>                 Key: COUCHDB-782
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-782
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Replication
>    Affects Versions: 0.10
>         Environment: Ubuntu, 9.10
>            Reporter: Till Klampaeckel
>
> So we had to restart replication on a server and here's something I noticed.
> At first I restarted the replication via the following command from localhost:
> curl -X POST -d '{"source":"http://localhost:5984/foo", "target":"http://remote:5984/foo"}' http://localhost:5984/_replicate
> In response, futon stats:
> W Processed source update #176841152
> That part is great.
> Last night I did not have immediate access to the shell so I restarted replication from remote (through curl on my mobile):
> curl -X POST -d '{"source":"http://user:pass@public.host:5984/foo", "target":"http://remote:5984/foo"}' http://user:pass@pubic.host:5984/_replicate
> The response in futon this morning:
> W Processed source update #1066
> ... and it kept sitting there like it was stalled and only continued in smaller increments.
> I restarted CouchDB and restarted from localhost - instant jump to 176 million.
> I'm just wondering what might be different accept for that one is against the public interface, vs. localhost. I'd assume that replication behaves the same regardless.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.