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 (JIRA)" <ji...@apache.org> on 2010/06/23 23:23:50 UTC

[jira] Created: (COUCHDB-810) Running multiple instances on one machine breaks replication

Running multiple instances on one machine breaks replication
------------------------------------------------------------

                 Key: COUCHDB-810
                 URL: https://issues.apache.org/jira/browse/COUCHDB-810
             Project: CouchDB
          Issue Type: Bug
          Components: Replication
    Affects Versions: 0.11, 0.10.2
            Reporter: Randall Leeds


Bob pointed out that the replication id does not include the port number. As a consequence, replication checkpoints between multiple instances running on the same machine can clobber one another. (Strangely, the port line is there but commented out.)

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


[jira] Resolved: (COUCHDB-810) Running multiple instances on one machine breaks replication

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

Robert Newson resolved COUCHDB-810.
-----------------------------------

         Assignee: Robert Newson
    Fix Version/s: 1.1
       Resolution: Fixed


patch applied in r965331.

> Running multiple instances on one machine breaks replication
> ------------------------------------------------------------
>
>                 Key: COUCHDB-810
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-810
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Replication
>    Affects Versions: 0.11.1, 1.0
>            Reporter: Randall Leeds
>            Assignee: Robert Newson
>             Fix For: 1.1
>
>         Attachments: 0001-versioned-replication-ids.patch
>
>
> Bob pointed out that the replication id does not include the port number. As a consequence, replication checkpoints between multiple instances running on the same machine can clobber one another. (Strangely, the port line is there but commented out.)

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


[jira] Updated: (COUCHDB-810) Running multiple instances on one machine breaks replication

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

Randall Leeds updated COUCHDB-810:
----------------------------------

    Attachment: 0001-versioned-replication-ids.patch

Patch again. Cleaned up separation of concerns a little.

> Running multiple instances on one machine breaks replication
> ------------------------------------------------------------
>
>                 Key: COUCHDB-810
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-810
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Replication
>    Affects Versions: 0.10.2, 0.11
>            Reporter: Randall Leeds
>         Attachments: 0001-versioned-replication-ids.patch
>
>
> Bob pointed out that the replication id does not include the port number. As a consequence, replication checkpoints between multiple instances running on the same machine can clobber one another. (Strangely, the port line is there but commented out.)

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


[jira] Updated: (COUCHDB-810) Running multiple instances on one machine breaks replication

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

Randall Leeds updated COUCHDB-810:
----------------------------------

    Attachment:     (was: 0001-versioned-replication-ids.patch)

> Running multiple instances on one machine breaks replication
> ------------------------------------------------------------
>
>                 Key: COUCHDB-810
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-810
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Replication
>    Affects Versions: 0.10.2, 0.11
>            Reporter: Randall Leeds
>         Attachments: 0001-versioned-replication-ids.patch
>
>
> Bob pointed out that the replication id does not include the port number. As a consequence, replication checkpoints between multiple instances running on the same machine can clobber one another. (Strangely, the port line is there but commented out.)

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


[jira] Updated: (COUCHDB-810) Running multiple instances on one machine breaks replication

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

Randall Leeds updated COUCHDB-810:
----------------------------------

    Affects Version/s: 1.0
                       0.11.1
                           (was: 0.11)
                           (was: 0.10.2)

> Running multiple instances on one machine breaks replication
> ------------------------------------------------------------
>
>                 Key: COUCHDB-810
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-810
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Replication
>    Affects Versions: 0.11.1, 1.0
>            Reporter: Randall Leeds
>         Attachments: 0001-versioned-replication-ids.patch
>
>
> Bob pointed out that the replication id does not include the port number. As a consequence, replication checkpoints between multiple instances running on the same machine can clobber one another. (Strangely, the port line is there but commented out.)

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


[jira] Commented: (COUCHDB-810) Running multiple instances on one machine breaks replication

Posted by "Robert Newson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-810?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12889650#action_12889650 ] 

Robert Newson commented on COUCHDB-810:
---------------------------------------

FYI: I tested with the script below. The patch works if you don't see this message with the patch applied for new and existing checkpoints (you need three local couchdb instances).

"no common ancestry -- performing full replication"

#!/bin/bash

PORTS="5985 5986 5987"

for PORT in $PORTS
do
  curl http://localhost:$PORT/db -X DELETE
  curl http://localhost:$PORT/db -X PUT
  curl http://localhost:$PORT/db/doc -d '{}' -X PUT
done

for I in 1 2 3
do
    curl http://localhost:5985/db/doc5985$I -d '{}' -X PUT
    curl http://localhost:5986/db/doc5986$I -d '{}' -X PUT
    curl http://localhost:5987/db/doc5987$I -d '{}' -X PUT

    curl http://localhost:5985/_replicate -d '{"source":"db","target":"http://localhost:5986/db"}'
    curl http://localhost:5985/_replicate -d '{"source":"db","target":"http://localhost:5986/db"}'
    curl http://localhost:5987/_replicate -d '{"source":"db","target":"http://localhost:5985/db"}'
    curl http://localhost:5987/_replicate -d '{"source":"db","target":"http://localhost:5986/db"}'

done


> Running multiple instances on one machine breaks replication
> ------------------------------------------------------------
>
>                 Key: COUCHDB-810
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-810
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Replication
>    Affects Versions: 0.11.1, 1.0
>            Reporter: Randall Leeds
>         Attachments: 0001-versioned-replication-ids.patch
>
>
> Bob pointed out that the replication id does not include the port number. As a consequence, replication checkpoints between multiple instances running on the same machine can clobber one another. (Strangely, the port line is there but commented out.)

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


[jira] Updated: (COUCHDB-810) Running multiple instances on one machine breaks replication

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

Randall Leeds updated COUCHDB-810:
----------------------------------

    Attachment: 0001-versioned-replication-ids.patch

Removing extraneous print. Sorry for the noise.

> Running multiple instances on one machine breaks replication
> ------------------------------------------------------------
>
>                 Key: COUCHDB-810
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-810
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Replication
>    Affects Versions: 0.10.2, 0.11
>            Reporter: Randall Leeds
>         Attachments: 0001-versioned-replication-ids.patch
>
>
> Bob pointed out that the replication id does not include the port number. As a consequence, replication checkpoints between multiple instances running on the same machine can clobber one another. (Strangely, the port line is there but commented out.)

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


[jira] Updated: (COUCHDB-810) Running multiple instances on one machine breaks replication

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

Randall Leeds updated COUCHDB-810:
----------------------------------

    Attachment: 0001-versioned-replication-ids.patch

Here's my attempt at a patch. I tried to make this all future proof by incorporating an algorithm that searches for old checkpoints using versioned clauses for the id generation function. Maybe it's overkill, but I think I kept things pretty clean. Old format checkpoint logs are migrated automatically.

I'd like to write up some etap tests, but I wanted to get it up for feedback.

> Running multiple instances on one machine breaks replication
> ------------------------------------------------------------
>
>                 Key: COUCHDB-810
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-810
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Replication
>    Affects Versions: 0.10.2, 0.11
>            Reporter: Randall Leeds
>         Attachments: 0001-versioned-replication-ids.patch
>
>
> Bob pointed out that the replication id does not include the port number. As a consequence, replication checkpoints between multiple instances running on the same machine can clobber one another. (Strangely, the port line is there but commented out.)

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


[jira] Commented: (COUCHDB-810) Running multiple instances on one machine breaks replication

Posted by "Robert Newson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-810?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12889649#action_12889649 ] 

Robert Newson commented on COUCHDB-810:
---------------------------------------

This patch looks good to me. I've done manual testing for new and upgrade scenarios.

I'm happy to commit this to trunk. I feel bad about no automated testing, but convincing the etap suite to run multiple local instances doesn't look simple.

> Running multiple instances on one machine breaks replication
> ------------------------------------------------------------
>
>                 Key: COUCHDB-810
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-810
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Replication
>    Affects Versions: 0.11.1, 1.0
>            Reporter: Randall Leeds
>         Attachments: 0001-versioned-replication-ids.patch
>
>
> Bob pointed out that the replication id does not include the port number. As a consequence, replication checkpoints between multiple instances running on the same machine can clobber one another. (Strangely, the port line is there but commented out.)

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


[jira] Updated: (COUCHDB-810) Running multiple instances on one machine breaks replication

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

Randall Leeds updated COUCHDB-810:
----------------------------------

    Attachment:     (was: 0001-versioned-replication-ids.patch)

> Running multiple instances on one machine breaks replication
> ------------------------------------------------------------
>
>                 Key: COUCHDB-810
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-810
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Replication
>    Affects Versions: 0.10.2, 0.11
>            Reporter: Randall Leeds
>         Attachments: 0001-versioned-replication-ids.patch
>
>
> Bob pointed out that the replication id does not include the port number. As a consequence, replication checkpoints between multiple instances running on the same machine can clobber one another. (Strangely, the port line is there but commented out.)

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