summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Build repos and push to couchdb-vm2jenkins-packages-2Joan Touzet2017-07-191-17/+31
|
* Fix _local_docs end-pointEric Avdey2017-07-187-127/+320
| | | | | | | | | | | | | | | | | | | 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
| | |
* | | Fix replication Javascript testNick Vatamaniuc2017-07-141-3/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The test was flaky for a variety of reasons: * waitForSeq only waited for 3 seconds and on failure it never explitly indicated an error and just waited for the comparison below to fail. So made it wait for 30 seconds and also throw an exception right away if it fails. * Last waitForSeq was used after task was canceled. So it just wasted time waiting until timeout as the task was null. So created a function to wait for task to be null. * waitForSeq spun in a tight do/while loop querying _active_tasks. In some test environment with minimal CPU resources that's not the greatest thing to do. So made it wait for 0.5 seconds between retries. * waitForSeq waited for replication task's through_seq value to match source update sequence from source db info. Those don't necessarily match. Instead made waitForSeq use the changes feed last sequence since that's what the replication task uses to update through_seq.
* | | Make replication filter fetch error for _replicate return a 404Nick Vatamaniuc2017-07-141-0/+2
| | | | | | | | | | | | Previously it returned a 500 error.
* | | Improve UNIX dependency installation (Node.JS, Sphinx)Joan Touzet2017-07-131-6/+31
| | | | | | | | | | | | Closes #664
* | | Change recommended install path to /opt/couchdbJoan Touzet2017-07-131-13/+12
| | | | | | | | | | | | Also includes pointers to couchdb-pkg daemon scripts.
* | | Bump ets_lru for flaky test fixPaul J. Davis2017-07-131-1/+1
| | |
* | | Add tests for queries against _users dbEric Avdey2017-07-133-0/+130
| | |
* | | Send user_ctx to fabric's open_docEric Avdey2017-07-132-2/+7
| | |
* | | Send user_ctx to query_viewEric Avdey2017-07-131-1/+1
| | |
* | | Pass UserCtx to fabric's all_docs from mango queryEric Avdey2017-07-131-2/+5
| | |
* | | Fix timeout in couchdb_views_test for couchdb_1283Paul J. Davis2017-07-131-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I believe the race here was that the query could return before the actual index updating process exited. Then it was just a race to creating a database before the monitor is released. If we do end up creating the database before the monitor is released then the database we want to have closed ends up being ignored as its not idle. The second two created databases then don't end up forcing the database from couch_server's LRU which leads us to the timeout waiting for DatabaseMonRef to fire. Fixes #655
* | | Avoid a race when restarting an index updaterPaul J. Davis2017-07-131-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was encountered during the test suite runs on Travis. It turns out that when we restart the indexer its possible to already have the 'EXIT' message in our mailbox. When we do we'll then crash with an unknown_info error since our updater pid was changed during the restart. This change simple filters any 'EXIT' message from the old updater from the mailbox before restarting thew new index updater. Fixes #649
* | | Prevent a terrible race conditionPaul J. Davis2017-07-131-18/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Looking into #649 I realized there's a pretty terrible race condition if an index is compacted quickly followed by an index update. Since we don't check the index updater message it would be possible for us to swap out a compaction change, followed by immediately resetting to the new state from the index updater. This would be bad as we'd possibly end up with a situation where our long lived index would be operating on a file that no longer existed on disk.
* | | Fix couchdb_os_proc_pool eunit timeoutsPaul J. Davis2017-07-121-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | There's a theory that the low memory limits on our CI instances are causing the tests spawning JS processes to fail. Given that we don't need them here we can trivially exclude that as a cause of the test failures. Fixes #631
* | | Update couch_native_proc to respect idle timeoutsPaul J. Davis2017-07-121-11/+35
| | |
* | | fix whitespace crimesRobert Newson2017-07-121-3/+3
| | |
* | | admin context in couch tests no longer necessary for compaction with the new ↵Frederick Kaempfer2017-07-123-3/+3
| | | | | | | | | | | | approach
* | | Require admin or db admin for compact requestsFrederick Kaempfer2017-07-121-2/+32
| | |
* | | Fix testFrederick Kaempfer2017-07-121-14/+12
| | |
* | | Add tests for db admin/db member compaction.Frederick Kaempfer2017-07-121-9/+73
| | |
* | | make sure to also run security check for design doc compactionFrederick Kaempfer2017-07-121-1/+1
| | |
* | | Require server or db admin user for db/_compact and db/_view_cleanup ↵Frederick Kaempfer2017-07-125-3/+131
| | | | | | | | | | | | endpoints following rnewson's suggestion
* | | Make couch_event_sup:stop/1 synchronousNick Vatamaniuc2017-07-111-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because `stop/1` is asynchronous, and casts a stop message and as result the client process could end getting killed during termination/cleanup phase if this sequence of events took place: 1. Client calls `stop(ListerPid).` 2. couch_event_sup casts a `stop` message to couch_event_sup gen_server 3. `stop` message is delayed and client continues executing. 4. Client calls something like application:stop/1`. 5. `application:stop/1` terminates couch_event_sup gen_server. 6. App termination kills client process because it is still linked. So this make the stop synchrounous by using call instead of cast. Issue #644
* | | Remove deprecated OAuth 1.0 implementationJoan Touzet2017-07-0921-1327/+5
| | | | | | | | | | | | | | | | | | | | | Helps resolve issue #656. Implementation broken since bigcouch merge. Replicator oauth hooks are left in place for future work towards adding cookie-based authentication support.
* | | Fix Windows release buildsJoan Touzet2017-07-091-3/+4
| | |
* | | Merge branch 'master' of https://github.com/apache/couchdbJoan Touzet2017-07-081-0/+1
|\ \ \
| * | | Disable compaction daemon on eunit run couch startupsJoan Touzet2017-07-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 21f9544 enabled the compaction daemon by default. And commit 3afe3ad disabled the compaction daemon at the start of the compaction daemon tests. Unfortunately, the compaction daemon remains active during all the other EUnit tests. I attempted to override the [compactions] _default line in the file rel/files/eunit.ini but specifying `_default=` or `_default=[]` did not provide the desired behaviour. This change disables the _default config as part of `test_util:start_couch` after startup. This means there is a very brief period during which the daemon is running, but in empirical testing the only thing I've seen it manage to do is compact `_dbs` before being disabled. Tested with `make soak-eunit` for 3 hours; this seems to eliminate the `all_dbs_active` error we've been seeing in CI runs since the compaction daemon was enabled by default.
* | | | Fix Windows buildJoan Touzet2017-07-082-1/+2
|/ / /
* | | Merge pull request #645 from cloudant/pass-user_ctx-in-fabric_view_mapEric Avdey2017-07-074-17/+30
|\ \ \ | | | | | | | | Pass db open options to fabric_view_map