jiangphcn opened a new pull request #1030: Make q configurable for peruser dbs
URL: https://github.com/apache/couchdb/pull/1030
 
 
   
   
   <!-- Thank you for your contribution!
   
        Please file this form by replacing the Markdown comments
        with your text. If a section needs no action - remove it.
   
        Also remember, that CouchDB uses the Review-Then-Commit (RTC) model
        of code collaboration. Positive feedback is represented +1 from 
committers
        and negative is a -1. The -1 also means veto, and needs to be addressed
        to proceed. Once there are no objections, the PR can be merged by a
        CouchDB committer.
   
        See: http://couchdb.apache.org/bylaws.html#decisions for more info. -->
   
   ## Overview
   At the moment, couch_peruser-managed databases are created with the default 
q value (8 is the CouchDB default, but users might change that). Now, in a 
peruser system, we recommend lower q because of all the file-descriptor 
overhead with larger q when peruser dbs are traditionally small-ish.
   
   This PR is aimed to introduce new item in `couch_peruser` config section to 
specify the q value when creating peruser database. The default value is 1 
instead of default value in `cluster/q`.
   ```
   [couch_peruser]
   ; If enabled, couch_peruser ensures that a private per-user database
   ; exists for each document in _users. These databases are writable only
   ; by the corresponding user. Databases are in the following form:
   ; userdb-{hex encoded username}
   enable = false
   ; If set to true and a user is deleted, the respective database gets
   ; deleted as well.
   delete_dbs = false
   +; set a default q value for peruser-created databases that is different from
   +; cluster / q
   +; +q = 1
   ```
   <!-- Please give a short brief for the pull request,
        what problem it solves or how it makes things better. -->
   
   ## Testing recommendations
   
   <!-- Describe how we can test your changes.
        Does it provides any behaviour that the end users
        could notice? -->
   make check skip_deps+=couch_epi apps=couch_peruser
   ```
   ======================== EUnit ========================
   module 'couch_peruser_test'
     couch_peruser test
   Application crypto was left running!
       couch_peruser_test:165: should_create_anon_user_db_with_default...[0.002 
s] ok
       couch_peruser_test:166: should_create_anon_user_db_with_default...ok
       couch_peruser_test:155: should_create_user_db_with_default...[0.003 s] ok
       couch_peruser_test:156: should_create_user_db_with_default...ok
       couch_peruser_test:178: should_create_user_db_with_q4...[0.004 s] ok
       couch_peruser_test:179: should_create_user_db_with_q4...ok
       couch_peruser_test:190: should_create_anon_user_db_with_q4...[0.003 s] ok
       couch_peruser_test:191: should_create_anon_user_db_with_q4...ok
       couch_peruser_test:202: should_not_delete_user_db...[0.004 s] ok
       couch_peruser_test:213: should_delete_user_db...[0.002 s] ok
       couch_peruser_test:242: should_reflect_config_changes...[0.003 s] ok
       couch_peruser_test:249: should_add_user_to_db_admins...[0.002 s] ok
       couch_peruser_test:258: should_add_user_to_db_members...[0.002 s] ok
       couch_peruser_test:277: should_not_remove_existing_db_admins...ok
       couch_peruser_test:278: should_not_remove_existing_db_admins...ok
       couch_peruser_test:279: should_not_remove_existing_db_admins...ok
       couch_peruser_test:297: should_not_remove_existing_db_members...ok
       couch_peruser_test:298: should_not_remove_existing_db_members...ok
       couch_peruser_test:299: should_not_remove_existing_db_members...ok
       couch_peruser_test:325: should_remove_user_from_db_admins...ok
       couch_peruser_test:326: should_remove_user_from_db_admins...ok
       couch_peruser_test:327: should_remove_user_from_db_admins...ok
       couch_peruser_test:353: should_remove_user_from_db_members...ok
       couch_peruser_test:354: should_remove_user_from_db_members...ok
       couch_peruser_test:355: should_remove_user_from_db_members...ok
   [os_mon] cpu supervisor port (cpu_sup): Erlang has closed
       [done in 51.394 s]
     [done in 53.426 s]
   module 'couch_peruser_sup'
   module 'couch_peruser_app'
   module 'couch_peruser'
   =======================================================
     All 25 tests passed.
   ==> rel (eunit)
   ==> couchdb (eunit)
   ```
   ## Related Issues or Pull Requests
   
   <!-- If your changes affects multiple components in different
        repositories please put links to those issues or pull requests here.  
-->
   https://github.com/apache/couchdb/issues/875
   ## Checklist
   
   - [X] Code is written and works correctly;
   - [X] Changes are covered by tests;
   - [ ] Documentation reflects the changes;
   

----------------------------------------------------------------
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

Reply via email to