summaryrefslogtreecommitdiff
path: root/src/mango
Commit message (Collapse)AuthorAgeFilesLines
* Set wait_for_built_index=True for 17-multi-type-value-test.pyBessenyei Balázs Donát2021-03-161-1/+1
|
* remove {restart_tx, true} from mango _all_docsGarren Smith2021-01-181-2/+1
|
* Disable TextIndex test since it is not implemeneted yetILYA Khlopotov2020-11-171-0/+4
|
* `q` and `n` are not needed for FDB based CouchDBILYA Khlopotov2020-11-171-1/+1
|
* Views on ebtreePaul J. Davis2020-09-303-10/+24
|
* Merge branch master into prototype/fdb-layerPaul J. Davis2020-09-1613-105/+376
|\
| * fix bookmark passing with text indexesfix-explain-text-indexesTony Sun2020-08-312-8/+19
| | | | | | | | | | | | | | | | | | | | | | Previously, we passed in the unpacked version of the bookmark with the cursor inside the options field. This worked fine for _find because we didn't need to return it to the user. But for _explain, we return the value back as unpacked tuple instead of a string and jiffy:encode/1 complains. Now we correctly extract the bookmark out of options, unpack it, and then pass it separately in it's own field. This way options retains it's original string form for the user so that invalid_ejson is not thrown.
| * bypass partition query limit for mangoTony Sun2020-08-271-1/+5
| | | | | | | | | | | | | | | | When partition_query_limit is set for couch_mrview, it limits how many docs can be scanned when executing partitioned queries. But this limits mango's doc scans internally. This leads to documents not being scanned to fulfill a query. This fixes: https://github.com/apache/couchdb/issues/2795
| * added $keyMapMatch Mango operatorMichal Borkowski2020-07-272-0/+41
| |
| * python black cleanupJoan Touzet2020-04-271-7/+3
| |
| * safer binary_to_term in mango_json_bookmarkmango-bookmark-masterRobert Newson2020-04-231-1/+1
| |
| * fix operator issue with empty arrays (#2805)Tony Sun2020-04-212-3/+25
| | | | | | | | | | | | | | | | | | | | | | Previously, in https://github.com/apache/couchdb/pull/1783, the logic was wrong in relation to how certain operators interacted with empty arrays. We modify this logic to make it such that: {"foo":"bar", "bar":{"$in":[]}} and {"foo":"bar", "bar":{"$all":[]}} should return 0 results.
| * Port elixir proxyauth tests from js to elixir (#2660)Juanjo Rodriguez2020-03-161-1/+1
| | | | | | | | * Add support for specify a custom config file for CouchDB startup during testing * Port proxyauth test from js to elixir
| * Improve mango markdownJay Doane2020-03-033-90/+274
| | | | | | | | | | | | This primarily wraps long lines and removes trailing whitespace in the README.md and TODO.md files. In `test/README.md`, it updates the default admin username and password used by `dev/run`.
| * Add coverage to Mango eunit testsJay Doane2020-03-031-0/+2
| |
| * Clean up mango test user docsJay Doane2020-03-032-0/+8
| | | | | | | | | | | | | | | | Tests based on class `UsersDbTests` don't clean up the user docs it puts in the `_users` db. This uses the classmethod `tearDownClass` to delete those docs. (cherry picked from commit 3d559eb14fd709662d3eb5cda8afe9a45687c3b1)
| * Clean up mango test dbsJay Doane2020-03-031-0/+4
| | | | | | | | | | | | | | | | | | After mango python tests are run, a bunch of dbs are typically left around, e.g. `mango_test_048b290b574d4039981893097ab71912` This deletes those test dbs after they are no longer in use. (cherry picked from commit e05e3cdc8d16d88e7c7af8fbcc4b671b81ac2693)
* | add back r and w optionsTony Sun2020-06-121-0/+12
| |
* | add test to make sure type <<"text">> design docs are ignored (#2866)Tony Sun2020-05-051-0/+8
| |
* | Fix mango test suitePaul J. Davis2020-04-271-1/+2
| |
* | Fix incorrect usage of couch_epi in mango pluginILYA Khlopotov2020-04-101-2/+5
| | | | | | | | | | Previously we used the value returned from couch_epi apply as is. However it returns a list of arguments passed in the same order.
* | Add mango_pluginILYA Khlopotov2020-04-093-10/+57
| | | | | | | | | | | | Implement the following extention points: - `before_find(Req) -> {ok, Req}` - `after_find(Req, HttpResp, KVs) -> {ok, KVs}`
* | remove defer and load_ddocs from mango_utilsGarren Smith2020-04-062-63/+0
| | | | | | | | Clean up unused mango_utils functions.
* | update mango tests to work with Mango on FDBGarren Smith2020-04-0613-134/+126
| |
* | Update mango test creds to same as elixir testsGarren Smith2020-04-062-4/+4
| |
* | Update Mango query to work with couch_viewsGarren Smith2020-04-068-146/+99
| |
* | Add mango indexingGarren Smith2020-04-065-19/+183
| | | | | | | | | | | | This uses couch_views_updater to create mango indexes in the doc update along with the couch_views_indexer to update the indexes in the background up to the creation versionstamp.
* | Remove quorum statsGarren Smith2020-04-063-13/+1
| | | | | | | | Removing quorum stats since they are not relevant with FDB.
* | Remove view_cb predicate push downGarren Smith2020-04-061-94/+1
| | | | | | | | | | Removes the view callback that was performed on the nodes before sending the results back to the co-ordinator.
* | remove unneeded r/w parameterGarren Smith2020-04-066-67/+6
| |
* | remove partition opts from mangoGarren Smith2020-04-0610-200/+10
| |
* | remove mango native procGarren Smith2020-04-061-373/+0
| |
* | Add operation names for all HTTP endpointsPaul J. Davis2020-03-021-1/+30
| | | | | | | | | | | | This adds operation names to all valid HTTP end points. This covers all of `make elixir` except for seven requests that are testing specific error conditions in URL and Methods for various endpoints.
* | Fix mango index validationPaul J. Davis2020-03-021-6/+1
|/ | | | | This check fails if Clouseau isn't present. Though we don't need Clouseau to perform the check so just avoid it.
* Fix Windows build (#2534)3.0.0-RC1Joan Touzet2020-02-083-6/+6
| | | | | | | | | | | | | | | | | | | | * Allows `configure.ps1` to correctly pull and build `rebar` on Windows * Removes the static declarations in `rebar.config.script` on specific, pre-determined paths to various includes/libraries necessary for NIFs and external binaries (expectation is these are passed in env vars INCLUDE, LIB and LIBPATH) * fixes the SM60 `couchjs` build by telling `windows.h` not to redefine min and max as macros through a `#define` * fixes the `make eunit` target on Windows * Adds the missing `EXE_LINK_CXX_TEMPLATE` that our rebar doesn't have, but `enc` has today, which is also causing a failed `couchjs` (C++) build on Windows * Causes `make python-black` to correctly cause failure in `make check` if it finds problems * fixes Mango tests on Python 3.8 by bumping the hypothesis dependency * fixes one Elixir test on Windows (incorrect calculation of `now(:ms)` due to Erlang clock precision difference) * a little bit of python black cleanup (mango tests)
* Return mango warnings as a delimited stringWill Holley2020-02-033-6/+6
| | | | | | | The CouchDB API defines the warning field returned by _find to be a string (and this is what Fauxton expects). 5d55e289 was missing a string conversion and returned the warning(s) as an array. This restores the intended behaviour.
* python-black style cleanup (#2505)Joan Touzet2020-01-311-1/+1
|
* quote strings for all text values (#2486)Tony Sun2020-01-273-1/+21
| | | | | | | | | | | | When a user issues a range query $lt, $lte, $gt, $gte for text indexes, the query is translated into a MIN, MAX range query against clouseau. If not quoted, an error occurs: {"error":"text_search_error","reason":"Cannot parse '(a_3astring:[\"\" TO string\\ containing\\ space})'..} This is because the string is broken up into 3 tokens which the parser cannot parse. If we add quotes to the string, the the range query works correctly.
* Python black cleanups (#2477)Joan Touzet2020-01-212-1/+5
|
* Handle not_found docs in mango text indexesarchive/mango_index_consistency_errormango_index_consistency_errorWill Holley2020-01-171-0/+4
| | | | | | mango_cursor_text:get_json_docs may return a not_found atom instead of a Doc. In this case, we should just ignore the hit instead of attempting to evaluate it against a mango selector.
* Instrument Mango execution statsWill Holley2020-01-174-10/+20
| | | | | | | | | | | | | | | | Adds metrics for mango execution statistics: * total docs examined (counter). Note that for non-quorum doc reads this needs to be counted at the shard level and not be the mango query coordinator * total results returned (counter) * query time (histogram) * mango:selector evaluations (may be queries or _changes feeds) For mrview-based queries which don't use quorum reads (the default), total docs examined should equal mango:selector evaluations. However, there are cases where mango selectors are evaluated outside of query time e.g. partial indexing, selector-based _changes which make it useful to maintain a distinct counter.
* Warn on mango index scanWill Holley2020-01-173-30/+57
| | | | | | | Adds a warning to the _find endpoint if the ratio of docs scanned: results returned is higher than a configurable threshold (default 10). This warning was previously generated in Fauxton; moving it to the server side allows us to expose it via _stats as well.
* Add mango.query_invalid_index counterWill Holley2020-01-171-0/+2
| | | | | Adds a metric to expose the number of Mango queries that could not use the index specified in the _find query.
* Refactor Mango warning generationWill Holley2020-01-173-42/+53
| | | | | | | | | | | | | | Refactor the code generating Mango warnings to (hopefully!) improve readability. This also moves the metric counter for unindexed queries such that it gets incremented only when no index is used. Previously, it would increment if *any* warning was generated (e.g. when Mango warned that the user-specified index was not found/valid but fell back to a different index). The warning string returned now also contains all warnings generated for the query, delimited via newlines - not just the first one.
* fix empty queries (#1783)Tony Sun2020-01-1611-16/+164
| | | | | | | | | | | | | | | | | | | | | | | * fix empty queries Mango text indexes currently throw function clauses when queries in two situations: 1) Empty Selector 2) Operators with empty arrays. We fix this issue and change the behavior as follows: 1) Any empty selector will fall back on _all_docs (like json indexes). 2) $or, $and, $in, $all that specify an empty arrays will be treated as no-op when combined with other operators. 3) A single no-nop query such as {"$or": []} will not be executed and return nothing just like json indexes. 4) $nin with an empty array will return all docs that match the field, just like json indexes. Co-authored-by: Jan Lehnardt <jan@apache.org> Co-authored-by: Peng Hui Jiang <jiangphcn@apache.org>
* Fix missing mango execution stats (part 2)Will Holley2020-01-082-52/+23
| | | | | | | | | | | | | | | | | The previous implementation of Mango execution stats relied on passing the docs_examined count from each shard to the coordinator in the view_row record. This failed to collect the count of documents read which weren't followed by a match (in a given shard). For example, if an index was scanned but no documents were matched, the docs_examined would be 0, when it should be equal to the number of documents in the index. This commit changes the implementation so that docs examined is passed only when each shard has completed its index scan. The work is split into 2 commits to support mixed-version cluster upgrades - the previous commit adds the message handlers only so can be safely rolled out without breaking in-flight requests.
* Fix missing mango execution stats (part 1)Will Holley2020-01-081-5/+11
| | | | | Adds message handlers to mango / all_docs / mrview fabric to recieve an execution_stats message.
* feat: add metric counter for unindexed mango queries. Closes #1913 (#2390)Jan Lehnardt2020-01-051-0/+1
|
* Speedup eunit: mango_idx_testPaul J. Davis2019-12-251-17/+30
|
* Set autoupdate:false during update=false mango test (#2314)Adam Kocoloski2019-11-161-1/+6
| | | | | | | | | Set autoupdate:false to avoid update=False flake The auto-indexer is sometimes sneaking in and causing test failures by building the index ahead of the update=false query. This should block that behavior. Also, save XML output from mango nose tests.