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 2019/08/07 17:01:11 UTC

[GitHub] [couchdb] iilyak opened a new pull request #2101: Refactor fabric:cleanup_index_files

iilyak opened a new pull request #2101: Refactor fabric:cleanup_index_files
URL: https://github.com/apache/couchdb/pull/2101
 
 
   #  Overview
   
   Previous implementation of `fabric:cleanup_index_files` assembled a regexp by concatenating active signatures.
   The approach caused regexp to exceed system limit in the case of huge number of them. 
   The stacktrace looked like follows: 
   ```
   2> fabric:cleanup_index_files().
   ** exception error: no match of right hand side value {error,{"regular expression is too large",37555}}
        in function  fabric:cleanup_index_files/1 (src/fabric.erl, line 519)
        in call from fabric:'-cleanup_index_files/0-lc$^0/1-0-'/1 (src/fabric.erl, line 501)
        in call from fabric:'-cleanup_index_files/0-lc$^0/1-0-'/1 (src/fabric.erl, line 501)
   ```
   
   This implementation uses different approach. It relies on the fact that view files are named as `${signature}.view`. This means that the signature of the file can be easily extracted using `filename:basename(FilePath, ".view")`. 
   
   ## Testing recommendations
   
   ```
   make exunit tests=src/couch/test/exunit/fabric_test.exs
   ```
   
   ## Related Issues or Pull Requests
   
   N/A
   
   ## 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


With regards,
Apache Git Services