summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Add default props at db creationuser-partitioned-dbsGarren Smith2018-07-041-5/+14
|
* Add props field to couch_db_engineGarren Smith2018-07-044-2/+117
| | | | Add the ability to store database properties to the couchdb engine.
* Don't set context for compaction files during db delete (#1419)Eric Avdey2018-06-292-3/+3
| | | | | | | | | When we delete files with context option set to `delete`, `couch_file` respects configuration flag "enable_database_recovery" and just renames the files in case it's set to true. This change removes context for compaction files deleted during database deletion to make sure we are actually erasing them and not just renaming and leaving behind.
* Merge pull request #1401 from Spotme/spotme/fix/couch-native-processiilyak2018-06-292-1/+49
|\ | | | | Fix for a function_clause crash in the couch_native_process for Erlang views
| * tests(couch_changes): add tests for changes feed filtering using an Erlang viewAlexanderKaraberov2018-06-291-1/+37
| |
| * fix(_view changes feed): fix function_clause crash in couch_native_process.AlexanderKaraberov2018-06-291-0/+12
|/ | | | Crash was caused by a missing implementation of ddoc function for <<"views">> FunPath, implementation is based on FilterFun but matches return values of the erlang:put() which is called in the native Emit function and also expects ok and false when docs were not emitted.
* Add regression runs on new dedicated FreeBSD VMJoan Touzet2018-06-271-1/+26
| | | | Thanks to Just Some Enterprises for donating the compute power!
* Update build dependency docs for FreeBSDJoan Touzet2018-06-271-2/+4
|
* Update snappy dep to CouchDB-1.0.1 with 21.0 supportNick Vatamaniuc2018-06-211-1/+1
| | | | Issue #1396
* Add constant index fields to sort based on the selector (#1376)garren smith2018-06-207-47/+392
| | | | | | | | This moves the sort check into the is_usable function for all indexes. For map/reduce indexes it can add any constant fields e.g {a: {"$eq": 4} to the prefix of the sort because it won't affect the actual sort but will increase the chance that an index is selected. This is a user experience fix to help a user if they don't add all the columns for an index to the sort fields.
* Prepare to fabric attachment receiver from a fun closure to a tupleNick Vatamaniuc2018-06-192-0/+170
| | | | | | | | | | | Passing closures around is fragile and prevents smooth upgrading. Instead pass a tuple with a data from the receiver closure explicitly and convert to back to a local fun locally on each node. This is a preparatory commit before the switch. To ensure attachment uploading requests are successful, would need to first install this change on all the nodes. Then in a separate upgrade step, switch fabric.erl to call fabric_doc_atts:receiver instead fabric_doc_attatchments:recevier.
* refactor process_request to not drop req (#1375)Tony Sun2018-06-191-5/+46
| | | | Previously, when we fail authorization but pass authentication, we use the old HttpReq which drops user_ctx. This change leaves user_ctx.
* Call `set_mqd_off_heap` for critical processesPaul J. Davis2018-06-195-0/+6
| | | | | | This uses the new `couch_util:set_mqd_off_heap/0` function to set message queues to off_heap for some of our critical processes that receive a significant amount of load in terms of message volume.
* Add set_mqd_off_heap utility functionPaul J. Davis2018-06-191-0/+10
| | | | | | | | | | | | In Erlang VMs starting with version 19.0 have a new process_flag to store messages off the process heap. This is extremely useful for processes that can have huge numbers of messages in their mailbox. For CouchDB this is most usually observed when couch_server backs up with a large message queue which wedges the entire node. This utility function will set a process's message_queue_data flag to off_heap in a way that doesn't break builds of CouchDB on older Erlang VMs while automatically enabling the flag on VMs that do support it.
* Fix couch_key_tree_tests.erlPaul J. Davis2018-06-161-5/+19
| | | | | | | | | | The `should_merge_tree_to_itself` and `should_merge_tree_of_odd_length` tests were both invalid as merging does not support merging of anything other than a linear path. This failure was covered up by the fact that the stem operation will detect and cover up any errors from a failed merge. Co-Authored-By: Nick Vatamaniuc <vatamane@apache.org>
* Optimize couch_key_tree:stem/2Paul J. Davis2018-06-163-22/+95
| | | | | | | | | | | | | | This is two related optimizations for stemming revisions. The first optimization re-writes the stemming algorithm to drop it from an O(N^2) to O(N) operation by using a depth first search through the tree and tracking which revisions are within `revs_limit` revs from a leaf dropping any revision that exceeds that limit. The second optimization is just that we avoid calling stemming more often than necessary by switching away from using `merge/3` to `merge/2` and then calling `stem/2` only when necessary. Co-Authored-By: Nick Vatamaniuc <vatamane@apache.org>
* Fix active size calculations for viewsPaul J. Davis2018-06-153-26/+90
| | | | | | | | | | | | | | | | | | | | It was brought to my attention that the active size looked a bit funny occasionally as it could be larger than the file size. Given that active size is defined to be the number of bytes used in a view file it must be strictly greater than or equal to zero as well as less than or equal to file size. Thus the great hunt had begun! While I'd love more than anything to regail you, Dear Reader, with the tales, the joys, the highs, and yes, even the lows of this search, it turns out that I cannot. I must not. For there were none! Turns out this was a trivial bug where we were re-using the ExternalSize calculation instead of applying `couch_btree:size/1` to all of the btrees in the `#mrview` records. Simple bug comes with a correspondingly simple fix. I also noticed that the info tests were broken and not being run so I spent a few minutes cleaning those up to make the various assumptions.
* Merge pull request #1387 from cloudant/make-bin_opt_info-optionalEric Avdey2018-06-152-5/+13
|\ | | | | Add compile's command line options, introduce `ERL_OPTS` and make `bin_opt_info` optional.
| * Allow custom compile options with env variableEric Avdey2018-06-142-4/+4
| |
| * Make bin_opt_info optional based on env variableEric Avdey2018-06-141-1/+6
| |
| * Remove debug_info from compile optionsEric Avdey2018-06-141-1/+1
| | | | | | | | | | | | Flag `debug_info` auto-propagated from rebar, so there are no need to set it manually or we'll end up with a double entry in opts.
| * Add compile's command line optionsEric Avdey2018-06-141-3/+6
| | | | | | | | | | | | Allow to compile a specified list of apps. Fix for eunit's OPTS regexp on systems with sed withouth GNU extension (i.e MacOS)
| * Revert "Introduce bin_opt_info erl_opts compilation option"Eric Avdey2018-06-141-1/+1
|/ | | | This reverts commit b58021e6d9751fa36a4164974664e86248d444fd.
* Update skip_deps for 3rd parties eunit (#1386)Eric Avdey2018-06-141-1/+1
|
* Jenkinsfile: typoJoan Touzet2018-06-111-1/+1
|
* Fix container for package-building stepJoan Touzet2018-06-091-2/+2
|
* Ignore trailing characters in a builtin reduceAdam Kocoloski2018-06-081-3/+3
| | | | What a kooky idea, but I guess we're committed to it.
* Use finalize operation to simplify _statsAdam Kocoloski2018-06-082-15/+18
| | | | | | Rather than packing the stats into an ejson object on each write we use a more compact tuple format on disk and then turn it into ejson at query time.
* Finalize in couch_mrview, but make it optionalAdam Kocoloski2018-06-082-7/+26
| | | | | If we're in a cluster, finalization runs at the coordinator. Otherwise, couch_mrview can run it directly to simplify things for consumers.
* Add hyper app to dependenciesNick Vatamaniuc2018-06-081-1/+2
| | | | | | Releases and dialyzer checks need app dependencies to work properly Issue: #1346
* Add _approx_count_distinct as a builtin reduce function (#1346)Adam Kocoloski2018-06-059-2/+78
| | | | | | | | | | | This introduces a new builtin reduce function, which uses a HyperLogLog algorithm to estimate the number of distinct keys in the view index. The precision is currently fixed to 2^11 observables andtherefore uses approximately 1.5 KB of memory. It also introduces a finalize step which can be used to improve the efficiency of other builtin reduce functions going forward. Closes COUCHDB-2971
* Update Jenkins build process:Joan Touzet2018-05-281-41/+83
| | | | | | * Newly provisioned images * Add ubuntu bionic (18.04) support * Add our own couch-js/couch-libmozjs185 pkgs to rolling repo build
* Mango: _id and _rev index selectionWill Holley2018-05-232-1/+20
| | | | | | | | | | | | | | | | | | | | | Mango requires that a JSON index can only be used to fulfil a query if the "selector" field covers all of the fields the index. For example, if an index contains ["a", "b"] but the selector only requires field ["a"] to exist in the matching documents, the index would not be valid for the query (because it only includes documents containing both "a" and "b"). There is a special case here around built-in fields; _id and _rev specifically, because they are guaranteed to exist in any matching documents. If a user declares an index ["a", "_id"], we can safely exclude "_id" from the index coverage check, so a selector of {"a": "foo"} should be able to use this index. Prior to this commit, a user would have to alter the selector so that it covered the "_id" field, e.g. {"a": "foo", "_id": {"$exists": true}}. The commit removes the need to explicitly cover _id or _rev fields in the query selector.
* Add SSL session_lifetime limit for ibrowse pidsJoan Touzet2018-05-101-0/+3
|
* Bump fauxton to fix CI buildsJoan Touzet2018-05-021-1/+1
|
* Force use of SMP enabled BEAM VM, fixes #1296Joan Touzet2018-04-301-0/+3
|
* Fix length badarg error in mp parserNick Vatamaniuc2018-04-171-1/+2
| | | | | | | | This was introduced in: https://github.com/apache/couchdb/commit/083239353e919e897b97e8a96ee07cb42ca4eccd Issue #1286
* Fix mem3 tests (#1285)Eric Avdey2018-04-174-93/+36
| | | | | | | | | | | | | | | | The changes listener started in setup of mem3_shards test was crashing when tried to register on unstarted couch_event server, so the test was either fast enough to do assertions before of that or failed on dead listener process. This change removes dependency on mocking and uses a standard test_util's star and stop of couch. Module start moved into the test body to avoid masking potential failure in a setup. Also the tests mem3_sync_security_test and mem3_util_test been modified to avoid setup and teardown side effects.
* Document enable_database_recovery ini optionJoan Touzet2018-04-131-0/+6
|
* Merge pull request #1273 from cloudant/adopt-fake_db-to-PSEEric Avdey2018-04-131-2/+24
|\ | | | | Adopt fake_db to PSE changes
| * Adopt fake_db to PSE changesEric Avdey2018-04-131-2/+24
|/ | | | | | | | | | With db headers moved into engine's state, any fake_db call, that's trying to setup sequences for tests (e.g. in mem3_shards) crashing with context setup failed. It's not trivial to compose a proper `engine` field outside of couch app, so instead this fix makes fake_db to set engine transparently, unless it was provided in a payload.
* In _scheduler/docs fix `crashing` state showing as `pending` sometimesNick Vatamaniuc2018-04-121-4/+78
| | | | | | | | | | | | | | | | | | | | | Replication jobs are backed off based on the number of consecutive crashes, that is, we count the number of crashes in a row and then penalize jobs with an exponential wait based that number. After a job runs without crashing for 2 minutes, we consider it healthy and stop going back in its history and looking for crashes. Previously a job's state was set to `crashing` only if there were any consecutive errors. So it could have ran for 3 minutes, then user deletes the source database, job crashes and stops. Until it runs again the state would have been shown as `pending`. For internal accounting purposes that's correct but it is confusing for the user because the last event in its history is a crash. This commit makes sure that if the last even in job's history is a crash user will see the jobs as `crashing` with the respective crash reason. The scheduling algorithm didn't change. Fixes #1276
* Merge pull request #1281 from apache/commit_data_pseRobert Newson2018-04-121-8/+9
|\ | | | | call commit_data where needed
| * call commit_data where neededRobert Newson2018-04-121-8/+9
|/ | | | Regression since introduction of PSE
* Set update_lru_on_read=false as defaultJoan Touzet2018-04-102-3/+6
|
* Minor documentation cleanup for couch_replicatorKyle Snavely2018-04-091-20/+21
|
* Switch to using a mirrored triq dependencyNick Vatamaniuc2018-04-091-2/+1
|
* Do not drop updated httpdb record after auth headers are updatedNick Vatamaniuc2018-04-061-4/+4
| | | | | | | | | | In replicator, after client auth plugin updates headers it could also update its private context. Make sure to pass the updated httpdb record along to response processing code. For example, session plugin updates the epoch number in its context, and it needs the epoch number later in response processing to make the decision whether to refresh the cookie or not.
* Kill fabric attachment receiver when middleman times outNick Vatamaniuc2018-04-041-2/+3
| | | | | | | | Attachment receiver process is started with a plain spawn. If middleman process dies, receiver would hang forever waiting on receive. After a long enough time quite a few of these receiver processes could accumulate on a server. Fixes #1264
* Key tree property testsNick Vatamaniuc2018-04-035-4/+537
| | | | | | | | | | | | | | | | Key tree module is a candidate to use property tests on as it mostly deals with manipulating a single data structure and functions are referentially transparent, that is, they aren't many side-effects like IO for example. The test consists of two main parts - generators and properties. Generators generate random input, for example revision trees, and properties check that certain properties hold, for example that after stemming all the leaves are still present in the revtree. To run the test: make eunit apps=couch suites=couch_key_tree_prop_tests