[
https://issues.apache.org/jira/browse/COUCHDB-2983?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15248747#comment-15248747
]
ASF subversion and git services commented on COUCHDB-2983:
----------------------------------------------------------
Commit 916b0cef98a406609843621033128ed0d2e15893 in couchdb-couch's branch
refs/heads/master from [~iilyak]
[ https://git-wip-us.apache.org/repos/asf?p=couchdb-couch.git;h=916b0ce ]
Change normalize_dbname semantic add dbname_suffix
normalize_dbname used to return last componenent of the shard path. But
it was doing so only if argument was passed as a binary. We change the
semantic of normalize_dbname so it does following:
1. expects either type binary or list
2. expect any kind of database name
- plain database name
- plain database name with '.couch' extension
- shard name with suffix (creation time)
- shard name with suffix (creation time) and .couch extension
3. always returns a binary containing all components of a database name
4. removes information about shard
5. removes shard's suffix
For cases we need last component of the path (old behaviour) we
intoroduce dbname_suffix/1
COUCHDB-2983
> is_replicator_db do not take into account shard's suffix
> --------------------------------------------------------
>
> Key: COUCHDB-2983
> URL: https://issues.apache.org/jira/browse/COUCHDB-2983
> Project: CouchDB
> Issue Type: Bug
> Components: Database Core, Replication
> Reporter: ILYA
> Assignee: ILYA
>
> We use number of ways to detect replicator db:
> 1. [<<"_replicator">> ==
> couch_db:normalize_dbname(Path)|https://github.com/apache/couchdb-fabric/blob/master/src/fabric_util.erl#L289]
> in fabric.
> 2. hardcoded as
> [<<"_replicator">>|https://github.com/apache/couchdb-couch-replicator/blob/master/src/couch_replicator_manager.erl#L166:L167]
> in replicator_manager
> 3. calculated as [lists:last(binary:split(mem3:dbname(DbName), <<"/">>,
> ...))|https://github.com/apache/couchdb-couch-replicator/blob/master/src/couch_replicator_manager.erl#L924]
> in replicator_manager:is_replicator_db
> We need to unify the way we do it. We also would want to make sure we remove
> shard's suffix from the last part of the path.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)