You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2020/10/21 01:05:42 UTC

[GitHub] [couchdb] jiangphcn opened a new pull request #3222: convert erlfdb_error 2101 to transaction_too_large for main

jiangphcn opened a new pull request #3222:
URL: https://github.com/apache/couchdb/pull/3222


   <!-- 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
   
   <!-- Please give a short brief for the pull request,
        what problem it solves or how it makes things better. -->
   If transaction exceeds byte limit using the `_bulk_docs` endpoint,  the `{u'reason': u'2101', u'ref': 3853288219, u'error': u'erlfdb_error'}` with 500 error code was returned.  This is user-friendly. Using this PR is to provide meaningful error message to users. 
   
   ## Testing recommendations
   
   <!-- Describe how we can test your changes.
        Does it provides any behaviour that the end users
        could notice? -->
   The test python code:
   ```
   import requests, json, random, string, os
   print(requests.post(
       "http://127.0.0.1:15984/foo/_bulk_docs"
       , json={
           "docs":
               [
                   {"foo": "".join(random.choice(string.ascii_lowercase) for x in range(16000000))}
               ]}
       , auth=('foo', 'bar')
   ).json())
   ```
   Original response:
   ```
   {u'reason': u'2101', u'ref': 3853288219, u'error': u'erlfdb_error'}
   ```
   New response:
   ```
   {u'reason': u'The request transaction is larger than 10MB', u'error': u'transaction_too_large'}
   ```
    make elixir tests=test/elixir/test/bulk_docs_test.exs
   make exunit tests=src/couchdb/test/elixir/test/bulk_docs_test.exs
   
   ```
   BulkDocsTest
     * test bulk docs raises error for invlaid `docs` parameter (75.5ms)
     * test bulk docs supplies `id` if not provided in doc (38.9ms)
     * test bulk docs can detect conflicts (64.4ms)
     * test bulk docs raises error for invlaid `new_edits` parameter (13.3ms)
     * test bulk docs raises error for missing `docs` parameter (13.0ms)
     * test bulk docs raises transaction_too_large error for transaction larger than 10MB (1384.9ms)
     * test bulk docs raises error for `all_or_nothing` option (13.6ms)
     * test bulk docs raises conflict error for combined update & delete (40.6ms)
     * test bulk docs emits conflict error for duplicate doc `_id`s (23.2ms)
     * test bulk docs can create, update, & delete many docs per request (78.3ms)
   
   
   Finished in 2.0 seconds
   10 tests, 0 failures
   
   Randomized with seed 913112
   ```
   ## Related Issues or Pull Requests
   
   <!-- If your changes affects multiple components in different
        repositories please put links to those issues or pull requests here.  -->
   
   
   ## Checklist
   
   - [X] Code is written and works correctly
   - [x] Changes are covered by tests
   - [ ] Any new configurable parameters are documented in `rel/overlay/etc/default.ini`
   - [ ] A PR for documentation changes has been made in https://github.com/apache/couchdb-documentation
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [couchdb] jiangphcn commented on pull request #3222: convert erlfdb_error 2101 to transaction_too_large for main

Posted by GitBox <gi...@apache.org>.
jiangphcn commented on pull request #3222:
URL: https://github.com/apache/couchdb/pull/3222#issuecomment-713661421


   thanks @nickva 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [couchdb] jiangphcn merged pull request #3222: convert erlfdb_error 2101 to transaction_too_large for main

Posted by GitBox <gi...@apache.org>.
jiangphcn merged pull request #3222:
URL: https://github.com/apache/couchdb/pull/3222


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [couchdb] jiangphcn commented on pull request #3222: convert erlfdb_error 2101 to transaction_too_large for main

Posted by GitBox <gi...@apache.org>.
jiangphcn commented on pull request #3222:
URL: https://github.com/apache/couchdb/pull/3222#issuecomment-713267995


   talked to @nickva before. He agrees that we can use +1 in https://github.com/apache/couchdb/pull/3215#pullrequestreview-512057759 to merge this PR.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org