| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| |
| |
| |
| |
| | |
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
|
| | | |
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| | |
* Add support for specify a custom config file for CouchDB startup during testing
* Port proxyauth test from js to elixir
|
| | |
| |
| |
| |
| |
| | |
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`.
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| | |
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)
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
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)
|
| | | |
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| | |
Previously we used the value returned from couch_epi apply as is.
However it returns a list of arguments passed in the same order.
|
| | |
| |
| |
| |
| |
| | |
Implement the following extention points:
- `before_find(Req) -> {ok, Req}`
- `after_find(Req, HttpResp, KVs) -> {ok, KVs}`
|
| | |
| |
| |
| | |
Clean up unused mango_utils functions.
|
| | | |
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| | |
Removing quorum stats since they are not relevant with FDB.
|
| | |
| |
| |
| |
| | |
Removes the view callback that was performed on the nodes before
sending the results back to the co-ordinator.
|
| | | |
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| |
| | |
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.
|
| |/
|
|
|
| |
This check fails if Clouseau isn't present. Though we don't need
Clouseau to perform the check so just avoid it.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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)
|
| |
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
|
| |
Adds a metric to expose the number of Mango queries that could not
use the index specified in the _find query.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
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>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
| |
Adds message handlers to mango / all_docs / mrview fabric
to recieve an execution_stats message.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
| |
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.
|