Github user davisp commented on the pull request:

    https://github.com/apache/couchdb-couch/pull/158#issuecomment-209546028
  
    This looks odd to me. So I have this right, an example:
    
    Path1 == <<"shards/00000000-ffffffff/username/dbname.234234234">>
    mem3:dbname(Path1) == <<"username/dbname">>
    couch_db:normalize_dbname(Path1) == <<"dbname">>
    
    We used the original normalize_dbname (though never by that name) to check 
if a db was a _replicator or _users db. The missing detail/assumption here was 
that we never cared if someone named a database like <<"foo/_replicator">> in 
so much as it'd just get picked up as a _replicator database. This patch and 
related changes appear to be wanting to avoid that when we've never cared 
before.
    
    However I'd go about this fairly differently. normalize_dbname used to be 
this:
    
    lists:last(binary:split(mem3:dbname(Path), <<"/">>, [global])).
    
    I'd just remove the global option so we only split once.    


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to