iilyak commented on a change in pull request #1605: Feature/user partitioned
databases
URL: https://github.com/apache/couchdb/pull/1605#discussion_r224014850
##########
File path: src/chttpd/src/chttpd_db.erl
##########
@@ -1592,6 +1676,18 @@ extract_header_rev(Req, ExplicitRev) ->
end.
+% cannot partition a system database
+validate_partition_database_create(DbName, Partitioned) ->
+ SystemId = DbName =:= ?l2b(config:get("mem3", "shards_db", "_dbs")) orelse
+ lists:member(DbName, ?SYSTEM_DATABASES),
Review comment:
This will not work for cases when the database name contain `/`. For example
the following would be broken (example is taken from
https://github.com/apache/couchdb/pull/1647#issuecomment-427804738 where one of
CouchDb users mention his use case).
```
account%2F85%2Fea%2F6075c6c1e266f8512e2233541bdb-201807
```
I think this should use `couch_db:is_systemdb(DbName)` which abstracts that
logic (keep in mind that there is an open PR which fixes it a little
https://github.com/apache/couchdb/pull/1647).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services