janl opened a new pull request #1253: [DISCUSS] Validate new document writes 
against max_http_request_size
URL: https://github.com/apache/couchdb/pull/1253
 
 
   This supersedes #1200.
   
   ## New Behaviour
   
   This variant introduces no new config variable and no formula, instead, 
there is a set of three hurdles each doc write has to pass:
   
   1. doc body size
   2. individual attachment size
   3. length of multipart representation of full doc body and including 
attachments.
   
   The validation path is now the following:
   
   - If a new doc body is > `max_document_size`, we throw an error.
   - If a new attachment is > `max_attachment_size`, we throw an error.
   - If the new doc body plus new and/or existing attachments is > 
`max_http_request_size`, we throw an error.
   
   ## Notes
   
   This is again just a sketch to show how something like this could look like. 
The patch is fairly minimal, but it does include a full additional 
`?JSON_ENCODE` of the doc body, and some munging of the attachment stubs, that 
I’d like to get a performance review for. I’m sure we can make this fast if we 
need to, but that would require a larger patch, so it’s this sketch for now.
   
   ## Compatibility 
   
   This also sets the max_document_size to 2 GB, to restore 1.x and 2.0.x 
compatibility as per 
https://github.com/apache/couchdb/pull/1200#issuecomment-370489809
   
   I’d suggest we make this a BC change in 3.0 to the suggest 64MB or whatever 
we feel is appropriate then.
   
   ## Formalities 
   
   - [x] Includes tests 
   - [ ] Documentation has been updated // waiting for consensus before doing 
this
   

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