summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Rewrite ddoc_cache to improve performanceoptimize-ddoc-cachePaul J. Davis2017-07-2629-356/+2436
| | | | | | | | | | | | | | | | | | | | | | | There were a couple issues with the previous ddoc_cache implementation that made it possible to tip over the ddoc_cache_opener process. First, there were a lot of messages flowing through a single gen_server. And second, the cache relied on periodically evicting entries to ensure proper behavior in not caching an entry forever after it had changed on disk. The new version makes two important changes. First, entries now have an associated process that manages the cache entry. This process will periodically refresh the entry and if the entry has changed or no longer exists the process will remove its entry from cache. The second major change is that the cache entry process directly mutates the related ets table entries so that our performance is not dependent on the speed of ets table mutations. Using a custom entry that does no work the cache can now sustain roughly one million operations a second with a twenty thousand clients fighting over a cache limited to one thousand items. In production this means that cache performance will likely be rate limited by other factors like loading design documents from disk.
* Remove duplicated eviction messagesPaul J. Davis2017-07-251-10/+1
| | | | | This is an old merge artifact that was duplicating the event notifications twice per design document update.
* Update default.ini with all changes since 2.0Joan Touzet2017-07-251-2/+20
|
* Strip ?rev off of logfile-uploader's printed URLJoan Touzet2017-07-241-1/+1
|
* Increase timeout in couch's couch_db_mpr_tests module to 30 secondsNick Vatamaniuc2017-07-241-21/+24
| | | | | | | | | | Previous default timeout of 5 seconds was not enough when running in an environment where disk access is severly throttled. To add a timeout, changed the test function into a test generator. That also made the `with` construct un-necessary. Fixes #695
* Fix link to changelog/whatsnewJoan Touzet2017-07-241-2/+2
|
* Merge branch 'master' of https://github.com/apache/couchdbNick Vatamaniuc2017-07-211-0/+470
|\
| * Restore Jenkins builds on masterJoan Touzet2017-07-211-0/+470
| |
* | Bump config dep to 1.0.1 (ncrease timeouts for set and get).Nick Vatamaniuc2017-07-211-1/+1
|/ | | | https://github.com/apache/couchdb-config/pull/16
* Do not persist restart times setting in os_daemons_testsJoan Touzet2017-07-211-1/+1
| | | | | | Looks like an oversight in commit 789f75d. Closes #703
* bump all deps to tagsJoan Touzet2017-07-211-11/+11
|
* Fix couch_peruser EUnit testJoan Touzet2017-07-211-28/+32
| | | | | | | | The test was repeatedly creating/deleting the exact same DB name, which is a recipe for disaster. Changed to use unique DB names. Closes #705.
* Improve JS restartServer() support functionJoan Touzet2017-07-211-10/+16
| | | | | | | | | | | Previously, we potentially could attempt to restart couch, immediately attempt to see if couch had restarted, and fail if the server wasn't there (pre- or post-restart). This change wraps all attempts to contact couch in restartServer() with try blocks and simplifies the check-if-restarted logic. Closes #669. May or may not help with #673.
* Explicitly mention Facebook "BSD+Patents" license in NOTICE perJoan Touzet2017-07-211-0/+2
| | | | | | LEGAL-303 Closes #697
* Temporarily disable Jenkins buildsJoan Touzet2017-07-211-327/+0
|
* Increase timeout of some replication testsNick Vatamaniuc2017-07-202-2/+2
| | | | | | | | Could reproduce issue #633 by limiting disk throughput in a VBox VM instance to about 5KB. Try to increase the timeouts to let it handle such apparent slowdowns. Fixed #633
* TMP: Add debug logging for failed assertionPaul J. Davis2017-07-191-0/+7
|
* Fix cancellation race in replication.js testsNick Vatamaniuc2017-07-181-1/+1
| | | | | | | | Replication cancelation doesn't immediately update active tasks. Instead, use the new `waitReplicationTaskStop(rep_id)` function to propery wait for the task status. Issue #634
* Simplify regression test for COUCHDB-1283Paul J. Davis2017-07-181-149/+21
| | | | | | | | | | | The previous version of this test relied on trying to bump into the all_dbs_active error from the couch_server LRU. This proves to be rather difficult to reliably provide assertions on behavior. In hindsight all we really care about is that the compactor holds a monitor against the database and then we can trust couch_server will not evict anything that is actively monitored. Fixes #680
* Remove get_details replicator job gen_server callNick Vatamaniuc2017-07-182-13/+0
| | | | | | | | | | | | | This was used from a test only and it wasn't reliable. Because of replicator job delays initialization the `State` would be either #rep_state{} or #rep. If replication job hasn't finished initializing, then state would be #rep{} and a call like get_details which matches the state with #rep_state{] would fail with the batmatch error. As seen in issue #686 So remove `get_details` call and let the test rely on task polling as all other tests do.
* Merge pull request #693 from cloudant/use-stop_sync-in-mem3-testiilyak2017-07-181-2/+2
|\ | | | | Use test_util:stop_config in mem3_util_test
| * Use test_util:stop_config in mem3_util_testILYA Khlopotov2017-07-181-2/+2
|/ | | | | | | The config:stop is asynchronous which causes test failures with error like the following {error,{already_started,<0.32662.3>}
* Merge pull request #691 from cloudant/3367-fix-test-caseiilyak2017-07-181-17/+17
|\ | | | | 3367 fix test case
| * Fix trailing whitespace issuesILYA Khlopotov2017-07-181-2/+2
| |
| * Use random name for _users db in testILYA Khlopotov2017-07-181-2/+3
| | | | | | | | | | | | | | | | We should use random names for databases. Otherwise the test fails with database already exists error. This commit uses random name for users db and corrects the section name for `authentication_db` setting. COUCHDB-3367
| * Use hashed password when we create admin in testILYA Khlopotov2017-07-181-1/+2
| | | | | | | | | | | | | | | | | | | | couch_server is responsible for calling hash_admin_passwords whenever "admin" section of config changes. However as you can see it from [here](https://github.com/apache/couchdb/blob/master/src/couch/src/couch_server.erl#L219) the call is asynchronous. This means that our test cases might fail when we try to using admin user while admin password is not yet hashed. COUCHDB-3367
| * Rename unused variablesILYA Khlopotov2017-07-181-12/+10
| | | | | | | | COUCHDB-3367
* | Fix test teardownPaul J. Davis2017-07-181-25/+31
| | | | | | | | | | | | | | | | We weren't stopping the correct set of applications as well as forgetting to unload meck. I've also changed the test generators so that they execute all of the provided assertions. Fix #687
* | fix double export of wait_updated/3Joan Touzet2017-07-181-2/+1
|/
* Fix _local_docs end-pointEric Avdey2017-07-176-48/+86
| | | | | | | | | | | | | | | | | | | This is a second attempt to fix _local_docs end-point. The previous one didn't work on big enough btree_local, because local btree doesn't have reduction fun, so reuse of couch_db_updater:btree_by_id_reduce/2 was crashing on a bad match as soon as btree_local was getting kp_node. Also using full fold to calculate total_rows value turned out to be resource expensive when a database have significant number of local documents. This fix avoids calculating of total_rows and offset instead always setting them to null and also setting to null update_seq when requested, since it doesn't have meaning in context of local documents. A fabric module fabric_view_all_docs.erl was copied and modified as fabric_view_local_docs.erl, because re-using it for processing of both types of the documents was getting rather convoluted. Jira: COUCHDB-3337
* Merge pull request #622 from cloudant/89551-keep_sending_changes-hotiilyak2017-07-171-2/+8
|\ | | | | Allow keep_sending_changes to use hot code upgrade
| * Allow wait_updated to switch to new module codeILYA Khlopotov2017-06-271-2/+5
| |
| * Allow keep_sending_changes to use hot code upgradeILYA Khlopotov2017-06-271-1/+4
| |
* | Merge pull request #628 from garrensmith/add-stable-to-mangoiilyak2017-07-174-7/+97
|\ \ | | | | | | Add stable and update support to Mango
| * | Add stable and update support to MangoGarren Smith2017-07-164-7/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This brings mango inline with views by supporting the new options `stable` and `update`. Fixes #621 chore: whitespace feat: add stale option to Mango fix: opts parsing
* | | Merge branch '3423-add-try-catch-mem3'Tony Sun2017-07-172-2/+41
|\ \ \
| * | | catch database not exist errorTony Sun2017-07-172-2/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If dbs do not exist, we catch the error for mem3_sync_security so that it can continue for databases that do exist. https://github.com/apache/couchdb/pull/538 COUCHDB-3423
* | | | feat: update for 2.0 patch by @guillettJan Lehnardt2017-07-163-39/+57
| | | | | | | | | | | | | | | | https://github.com/apache/couchdb-peruser/pull/3
* | | | bump couchdb-setup depJoan Touzet2017-07-161-1/+1
| |/ / |/| |
* | | Merge pull request #682 from apache/strong_rand_bytesRobert Newson2017-07-168-11/+11
|\ \ \ | | | | | | | | use crypto:strong_rand_bytes
| * | | use crypto:strong_rand_bytesRobert Newson2017-07-168-11/+11
|/ / /
* | | Merge pull request #681 from apache/remove-couch-cryptoRobert Newson2017-07-1625-146/+59
|\ \ \ | | | | | | | | Remove couch_crypto
| * | | Remove couch_cryptoRobert Newson2017-07-1625-146/+59
| | | | | | | | | | | | | | | | | | | | The crypto:{hash,hash_init,hash_update,hash_final} functions exist in all the versions of erlang supported by CouchDB.
* | | | Merge branch '3430-external-size-views'Tony Sun2017-07-152-12/+49
|\ \ \ \
| * | | | calculate data_size correctly3430-external-size-viewsTony Sun2017-07-152-12/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, we were calculating the ExternalSize for views by summing up all the nodes in the btree. Furthermore, this was the compressed size. Now we modify the reduce function to return an ExternalSize for uncompressed values in the KVList. PR: https://github.com/apache/couchdb/pull/608 COUCHDB-3430
* | | | | Revert "Revert "Use Ejson Body Instead of Compressed Body for External size ↵Robert Newson2017-07-153-4/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#606)"" This reverts commit c8ee29505c718ed6bd9687a664dae11d984d89a7. PR is here: https://github.com/apache/couchdb/pull/606
* | | | | Revert "Use Ejson Body Instead of Compressed Body for External size (#606)"Robert Newson2017-07-153-42/+4
|/ / / / | | | | | | | | | | | | This reverts commit dce6e34686329e711e1a6c50aae00761ecb3262e.
* | | | Use Ejson Body Instead of Compressed Body for External size (#606)Tony Sun2017-07-153-4/+42
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use ejson body instead of compressed body for external size In two places where we calculate the ExternalSize of the document body, we use the Summary which is a compressed version of the doc body. We change this to use the actual ejson body. In copy_docs we don't have access to the #doc record so we can't access the meta where we store the ejson body. Unfortunately, this means we have to decompress the document body after reading it from disk. COUCHDB-3429
* | | Fix flaky os daemons testsNick Vatamaniuc2017-07-141-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "should die" test was close to the edge of timing out. Daemon started up, slept for 1 second then died. However max_retries is 3 so the whole thing was happening 3 times in a row. The total wait was 4 seconds, but on slow machines 1 extra second was not enough for the overhead of forking the 3 processes and other setup stuff. Set restart times to 2. Hopefully 4 seconds should be enough overhead for 2 restarts. Also adjust sleep time for the "die quickly" test. 1 second there might not be enough for both restarts, so made it 2 just to be safe. Issue #675
* | | Remove unused TIMEOUT macro from os daemons moduleNick Vatamaniuc2017-07-141-1/+0
| | |