summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Avoid calls to `fabric:design_docs/1`fix-get-minimum-purge-seqPaul J. Davis2018-12-071-23/+3
| | | | | The underlying clustered _all_docs call can cause significant extra load during compaction.
* Add `couch_db:get_design_doc/2`Paul J. Davis2018-12-072-0/+19
| | | | | This adds an API call for looking up a single design doc regardless of whether the database is clustered or not.
* Refactor elixir test suite initialization (#1779)Ivan Mironov2018-12-074-262/+272
| | | | * Move CouchTestCase to separate file * Move setup context functions to separate module
* Add Credo to Elixir test suite (#1769)Alessio Biancalana2018-12-0718-376/+790
| | | This PR adds Credo as the static code analysis tool of choice for the Elixir test suite.
* Format and check all code using python black (#1776)Joan Touzet2018-12-0635-2813/+2022
| | | | | The Makefile target builds a python3 venv at .venv and installs black if possible. Since black is Python 3.6 and up only, we skip the check on systems with an older Python 3.x.
* Filter out empty missing_revs results in mem3_repNick Vatamaniuc2018-12-061-2/+6
| | | | | This avoids needlessly making cross-cluster fabric:update_docs(Db, [], Opts) calls.
* Merge pull request #1797 from apache/ignore-clang-compile-commands-db-fileJoan Touzet2018-12-061-0/+1
|\ | | | | Ignore clang compile commands database file
| * Ignore clang compile commands database fileEric Avdey2018-12-061-0/+1
|/ | | | | New rebar leaves behind a clang compile commands database file after compiling the ports.
* Merge pull request #1790 from cloudant/move-tests-to-suiteiilyak2018-12-042-91/+121
|\ | | | | Move tests to suite
| * mock couch_logILYA Khlopotov2018-12-031-3/+24
| |
| * Fix expected result from testILYA Khlopotov2018-12-031-1/+1
| |
| * Move couch_flags_config tests into its own moduleILYA Khlopotov2018-12-032-91/+100
|/
* Merge pull request #1786 from apache/no-dev-data-dirJoan Touzet2018-11-301-1/+0
|\ | | | | dev/run: do not create needless dev/data/ dir
| * Merge branch 'master' into no-dev-data-dirno-dev-data-dirJoan Touzet2018-11-302-5/+3
| |\ | |/ |/|
* | Use devclean on elixir target for consistency of Makefile (#1785)Eric Avdey2018-11-302-5/+3
| | | | | | Use devclean on elixir target for consistency of Makefile
| * dev/run: do not create needless dev/data/ dirJoan Touzet2018-11-301-1/+0
|/
* Merge pull request #1780 from apache/2.3.0-prep2.3.1-last2.3.0-RC12.3.0Joan Touzet2018-11-293-4/+4
|\ | | | | Bump fauxton, docs, version to 2.3.0
| * Bump fauxton, docs, version to 2.3.0Joan Touzet2018-11-293-4/+4
|/
* fix: re-enable _doc_id & _design_docs filter optimisation paths (#1771)Jan Lehnardt2018-11-293-17/+53
|
* Cache query servers in ets table (#1778)iilyak2018-11-291-34/+46
| | | | | | | | The configuration of query servers is done via environment variables. Calling os:getenv every time we need a new query process is expensive. Instead we extact all configured query servers from the environemt on `couch_proc_manager` startup and cache them in ets table. fixes #1772
* Use fabric to get design docs in the compaction daemonNick Vatamaniuc2018-11-281-11/+16
| | | | | | | | | | | | | Previously the compaction daemon looked for design docs in each shard file. This worked well for versions < 2.x, however, for clustered databases design documents will only be found in their respective shards based on the document id hashing algorithm. This meant that in a default setup of Q=8 only the views of one shard range, where the _design document lives, would be compacted. The fix for this issue is to use fabric to retrive all the design documents for clustered database. Issue #1579
* test: port large_docs.js to Elixir test suite (#1745)Alessio Biancalana2018-11-282-1/+41
|
* test: port coffee.js to Elixir test suite (#1760)Alessio Biancalana2018-11-282-1/+69
|
* Merge pull request #1767 from van-mronov/mix-formatJoan Touzet2018-11-2721-507/+807
|\ | | | | Check code format before running elixir test suite
| * Merge branch 'master' into mix-formatJoan Touzet2018-11-2715-107/+52
| |\ | |/ |/|
* | Merge pull request #1764 from apache/switch-scripts-to-python3Joan Touzet2018-11-2715-107/+52
|\ \ | | | | | | | | | * Switch scripts to python3 * Update mango test harness to use venv
| * | Don't use activate script; Windows fixesswitch-scripts-to-python3Joan Touzet2018-11-275-17/+17
| | |
| * | Run mango tests with Python 3Nick Vatamaniuc2018-11-2610-89/+33
| | | | | | | | | | | | | | | | | | | | | | | | Before we were ignoring venv setup in the Makefile, so update the test runner to use that instead of pestering developers to install those dependencies by hand. Issue #1632
| * | Switch to python 3Nick Vatamaniuc2018-11-264-10/+11
|/ / | | | | | | | | | | Ran 2to3 and fixed a few deprecated warnings Issue #1632
| * Update win makefileIvan Mironov2018-11-271-1/+4
| |
| * Format elixir testIvan Mironov2018-11-2718-505/+792
| |
| * Add elixir-check-formatted make taskIvan Mironov2018-11-271-1/+5
| |
| * Add formatter configIvan Mironov2018-11-271-0/+6
|/
* Implement replicator session refresh based on cookie max ageNick Vatamaniuc2018-11-263-26/+119
| | | | | | | | | | | | | | | | | | | | | | | | | | | Force couch_replicator_auth_session plugin to refresh the session periodically. Normally it is not needed as the session would be refreshed when requests start failing with a 401 (authentication) or 403 (authorization) errors. In some cases when anonymous writes are allowed to the database and a VDU function is used to forbid writes based on the authenticated in username, requests with an expired session cookie will not fail with a 401 and the session will not be refreshed. To fix the issue using these two approaches: 1. Use cookie's max-age expiry time to schedule a refresh. To ensure that time is provided in the cookie, switch the the option to enable it by default. This handles the issue for endpoints which are updated with this commit. 2. For endpoints which do not put a max-age time in the cookie, use a value that's less than CouchDB's default auth timeout. If users changed their auth timeout value, and use VDUs in the pattern described above, and don't update their endpoints to version which sends max-age by default, they could adjust `[replicator] session_refresh_interval_sec` to their auth timeout minus some small delay. Of course refresh based on auth/authz failures should still works as before. Fixes #1607
* test: port lots_of_docs.js to Elixir test suite (#1738)Alessio Biancalana2018-11-262-1/+96
|
* Merge pull request #1761 from cloudant/fix-couch_epi-typespeciilyak2018-11-232-2/+9
|\ | | | | Fix couch_epi typespec for data provider
| * Fix couch_epi typespec for data providerILYA Khlopotov2018-11-232-2/+9
|/ | | | | | | | | | There were few problems: - `module` was renamed into `static_module` - https://github.com/apache/couchdb/commit/0fefc859eb9c18120064317da61a30adaeac5f92#diff-d9e3e3c91d4866fe966666619bda7991 - `callback_module` was added - https://github.com/apache/couchdb/commit/cf65280466499d652cff1171a2039af49c5677e8#diff-d9e3e3c91d4866fe966666619bda7991 - data provider specification can include options - https://github.com/apache/couchdb/blob/master/src/couch_epi/src/couch_epi_plugin.erl#L143
* Merge pull request #1754 from cloudant/do-not-use-list-as-config-keyiilyak2018-11-232-33/+67
|\ | | | | Do not use [] in feature_flags configuration
| * Replace erl_parse based parser with our ownILYA Khlopotov2018-11-231-8/+42
| |
| * Do not use [] in feature_flags configurationILYA Khlopotov2018-11-222-27/+27
|/ | | | | | | | [] characters are fobidden in configuration keys for security reason. Use list without [] to configure flags. Example configuration: [feature_flags] foo,bar,baz||test* = true
* feat: do not record server admin requests as cache misses (#1755)Jan Lehnardt2018-11-222-5/+13
| | | Closes #1746
* Merge pull request #1629 from ↵iilyak2018-11-2213-62/+272
|\ | | | | | | | | cloudant/84736-handle-db-deletion-in-load_validation_funs handle db deletion in load validation funs
| * Handle db deletion in couch_db:load_validation_funsILYA Khlopotov2018-11-2213-62/+272
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously there were quite a few problems with load_validation_funs in the case when clustered database is deleted. - the calls to load_validation_funs were failing with `internal_server` error [1] - the deleted database stayed opened because: - the caller of the load_validation_funs (update_doc) stayed alive - the main_pid of the deleted database wasn't killed either - there was an infinite loop in ddoc_cache_entry trying to recover ddoc from deleted database The solution is: - do not call `recover` for deleted database - close `main_pid` - use `erlang:error` to crash the caller [1] - The stack trace was: ``` {database_does_not_exist,[ {mem3_shards,load_shards_from_db,"bailey/meta",[ {file,"src/mem3_shards.erl"},{line,394}]}, {mem3_shards,load_shards_from_disk,1,[ {file,"src/mem3_shards.erl"},{line,369}]}, {mem3_shards,for_db,2,[ {file,"src/mem3_shards.erl"},{line,54}]}, {fabric_view_all_docs,go,5,[ {file,"src/fabric_view_all_docs.erl"},{line,24}]}, {ddoc_cache_entry_validation_funs,recover,1,[ {file,"src/ddoc_cache_entry_validation_funs.erl"},{line,33}]}, {ddoc_cache_entry,do_open,1,[ {file,"src/ddoc_cache_entry.erl"},{line,294}]}]} ```
* Merge pull request #1744 from cloudant/fix-_design_docs_total_rowsEric Avdey2018-11-219-50/+289
|\ | | | | Fix total_rows value for queries on `_design_docs` handler
| * Add a new test suite for _design_doc handlerEric Avdey2018-11-212-1/+146
| |
| * Remove empty spaces from couch_mrview_test_utilEric Avdey2018-11-211-1/+1
| |
| * Fix misleading assertion in design_docs_query.js testEric Avdey2018-11-211-1/+1
| |
| * Remove ending spaces from design_docs_query.jsEric Avdey2018-11-211-18/+18
| |
| * Fix total_rows for _design_docs with keysEric Avdey2018-11-214-29/+115
| | | | | | | | | | | | This adds a new fabric provider for getting a counter for design docs in a database. It allows for a valid query for total_rows when _design_docs handler queried with an array of keys.
| * Fix total_rows for _design_docs handlerEric Avdey2018-11-212-0/+8
|/