| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|\
| |
| | |
catch and log any error from mem3:local_shards
|
|/ |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The `/_node/_local/_prometheus` is a missing `TYPE` annotation for
`couchdb_httpd_status_codes`.
In addition, it contains no `HELP` annotations, which
are useful when exploring the metrics, particularly where
metrics do not strictly match those returned by the `_stats` or
`_system` endpoints.
This PR adds the missing `TYPE` annotation and adds `HELP` annotations
to all metrics.
The spec for the prometheus text format is at
https://github.com/prometheus/docs/blob/main/content/docs/instrumenting/exposition_formats.md,
for reference.
It also adds additional spacing between the metrics series, making it
easier for humans to parse.
## couch_prometheus_util:to_prom/3
`couch_prometheus_util:to_prom/3` is replaced by `couch_prometheus_util:to_prom/4`.
which now expects a description alongside the metric name and type.
## couch_prometheus_util:couch_to_prom/3
`couch_prometheus_util:couch_to_prom/3` now extracts the metrics
description from the metric metadata returned by `couch_stats`.
In some cases, where the metrics are transformed e.g. from multiple
metrics to a single metric with a tag, the description is explicitly
specified to match the new metric semantics.
|
|
|
|
| |
Migrate the settings `with_proper` and `erlang_md5` to `configure.ps1`
to add it to `config.erl`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are a few minor improvements:
- Add more tests to check sandboxing resets, and that docs are "frozen".
- Remove the extra `\n` and `"` around function body lines. Erlang can do
multi-line binaries just fine. Mark the sections with %erlfmt-ignore to the
formatter doesn't complain.
- Generalize `should_create_sandbox` test to check for the `not defined` string
only. Experimenting with QuickJS noticed that it uses single quotes
around`'Object.foo' is not defined` and SM doesn't. So check for `not
defined` part only as it's obvious enough what the check is about.
- Make sure to return test procs back to the pool. Previously, none of the
tests returned the processes back into the pool, and when the tests ended,
they were forcibly killed which resulted in log noise that looked like:
```
erl_child_setup: failed with error 32 on line 265
erl_child_setup: failed with error 32 on line 265
...
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`couch_prometheus_util:counter_metric/1` is intended to add a
`_total` suffix to the name of metrics with type `counter` if
the name does not already end with `_total`.
The implementation was previously incorrect, resulting in metrics
with names like `document_purges_total_total`.
This adds basic eunit tests for the failure / success scenarios and
fixes the implementation.
It is a breaking change for consumers of the `_node/_local/_prometheus`
endpoint, however, since the following metric is renamed:
* `couchdb_document_purges_total_total` -> `couchdb_document_purges_total`
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Filter view functions feature re-uses view map function for filtering _changes
feeds. Instead of accumulating emitted KVs, it uses custom emit() function
which just toggles a flag. However, in order to use this optimisation, the
function is compiled first with the regular emit function, then the function
source is queried with a non-portable toSource() method, and re-compiled again
with a new sandbox where emit is overridden.
Instead of reparsing and re-compiling it, pass the sandbox to the compile
function and compile filter views with that correct sandbox to start with.
Moreover, this helps remove another non-portable function call.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The `_node/_local/_prometheus` was returning duplicate rows for the
following metrics:
```
couchdb_erlang_memory_bytes
couchdb_erlang_gc_collections_total
couchdb_erlang_gc_words_reclaimed_total
couchdb_erlang_context_switches_total
couchdb_erlang_reductions_total
couchdb_erlang_processes
couchdb_erlang_process_limit
```
Prometheus will gracefully handle the duplication, picking the first
entry only, but it bloats the response and can potentially cause
unexpected results if there's a signficant delay capturing the
samples.
The duplication is caused by a duplicate function call to
`get_vm_stats()` in the prometheus endpoint handler. Removing the
duplicate call fixes the problem.
|
| |
|
| |
|
|
|
|
|
|
| |
- Add `adm:pass` to DB's URL to prevent unauthorized error
- Add `new_edits:false` to the request JSON object to generate conflicts
- Code reformatting by Rubyfmt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* mango: Remove unused `op_insert`
The `op_insert` elements in the abstract representation of the
translated Lucene queries do not seem to be produced anywhere in
the code. This might have been left over a while ago, and now
retire it.
* mango: Remove unused directory include
* mango: Equip text index selection with tests, specs, and docs
- Add specifications for the important functions that play some
role in the text index selection. This would help to understand
the implicit contracts around them and the associated data flow.
- Introduce `test_utils:as_selector/1` to make it easier to build
valid Mango selectors for testing. On the top level, it uses
Erlang maps to ensure the structural consistency of the input
(selectors are JSON objects that can be considered maps). Maps
are then validated and normalized by `jiffy` and Mango's internal
normalization rules for selectors for additional correctness,
they eventually become embedded JSON objects. This facilities
writing better unit tests that are closer to the real-world use.
At the same time, it comes with a dependency on these tools and
their misbehavior can cause test failures.
- Add unit tests for the major functions that contribute to the
index selection logic and boost the test coverage of the
`mango_idx_text` and `mango_selector_text` modules. That is
important because running integration tests on a higher level
requires a working Clouseau instance, which may not always be
available. With these unit tests in place, changes in the code
can be tracked easily. Also, the test cases can aid the reader
to get a better understanding of the assumed behavior.
- Explain the purpose of `mango_idx_text:is_usable/3` as this is
not trivial to catch at the first sight. Thanks @mikerhodes for
providing the input.
* mango: Refactor index selection tests
* mango: Correct text index selection for `$regex`
For the `$regex` operator, text indexes can be overly permissive
which can cause that they are selected even if they could not
serve the corresponding query. Rework the interpreteration of
`$regex` to avoid such problems.
|
| |
|
|
|
| |
The erlfmt executable likes POSIX paths on Windows too.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
While reading the documentation, noticed a couple of problems with
the HTML version, of which this change covers:
- Parameter types for JSON objects are not uniform. The type `json`
could either ambigiously refer to objects or arrays and used
randomly.
- The `Content-Type` header for response descriptions is not always
put in a list, though probably that is the right choice because
there can be many.
- Indentation of paragraphs and list items is off sometimes which
causes rendering mistakes.
- Formatting of JSON examples is not uniform by indentation.
- Add a couple of missed markdown for names, such as operators,
to make them stand out from the text for better readability.
- Unify style: use colons for the sentences that introduce
examples, end sentences with full stops, lose contractions,
regularize elaboration of object details for index descriptions
and definitions.
- Fix the reference to views in design documents when talking
about indexes.
- Add link for `_find` at the section about the index selection.
|
|
|
|
|
|
|
|
|
| |
- Add `python-black-update` for `make help`.
- In the output of `make help`, diffentiate between Erlang and
Python source code checks.
- Include the use of `black` in the developer documentation.
- Hide `erlfmt` commands for the respective targets. This makes
the targets consistent with their Windows versions.
|
|
|
|
|
|
|
| |
When using replication, we need to specify a username and password
(`adm:pass` / `admin:password`) for the replication endpoint URL,
otherwise a 401 unauthorized error will be thrown.
Co-authored-by: jiahuili <Jiahui.Li@ibm.com>
|
| |
|
|
|
|
|
|
|
|
| |
This fails more often on MacOS CI workers [1] but it seems to be a general
flaky test as the users auth ddoc is not guaranteed to be inserted
synchronously.
[1] https://github.com/apache/couchdb/issues/4397#issue-1551336429
|
|
|
|
|
|
|
|
|
|
|
|
| |
Try to fix flaky test which was noticed on the MacOS CI worker [1]:
```
[2023-02-17T07:40:34.978Z] ets_lru_test:285: -test_limits/2-fun-7- (Expire leaves new entries)...ok
[2023-02-17T07:40:34.978Z] ets_lru_test:292: -test_limits/2-fun-5- (Entry was expired)...*failed*
[2023-02-17T07:40:34.978Z] in function ets_lru_test:'-test_limits/2-fun-5-'/2 (test/ets_lru_test.erl, line 294)
```
[1] https://github.com/apache/couchdb/issues/4397#issuecomment-1434764920
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Interval was not read from the correct section.
The tests had the correct section.
This should fix the prometheus flaky test [1]. This was apparent on MacOS
a bit more. The interval in the test was still 5 seconds instead of 1,
so it was right at the edge of timing out (5 seconds is the default
eunit timeout).
[1] https://github.com/apache/couchdb/issues/4397#issuecomment-1425027913
|
| |
|
|
|
|
|
|
| |
build.
Issue: #4442
|
|
|
|
| |
This is intended to speed up feature checks.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
It hides the shard-sync and purge documents from the response unless a `?include_system=true` is given.
Fixes #3930
|
|
|
|
| |
Multi-arch images were updated in https://hub.docker.com/r/apache/couchdbci-debian/tags
|
|
|
|
| |
The pattern {var} has been established to clarify dynamic parameters in the documentation.
Standardization and clarification of some not yet converted notation of parameters.
|
| |
|
|
|
|
| |
Proxy auth can now use one of the configured hash algorithms
from chttpd_auth/hash_algorithms to decode authentication tokens.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit groups a couple of major changes that aim to amend
many pain points in making the Mango integration test suites
more accessible.
- The test framework behind the Mango integration test suite
provides a lot of flags that are not currently exposed on
the level of the main `Makefile`. Change this for the
greater flexilibility.
- Mango's test suite documentation is buried in the source tree,
which is not common for other kind of tests. To increase its
visibility and unify the style, move the contents of this file
over to the general developer documentation.
- Promote the use of the `mango-test` target instead of setting
up the related machinery manually. The commands recorded in
the original documentation are out of date and only minor
implementation details anyway.
- Retire the explicit control over the activation of Mango
integration tests that require support for text indexes.
Instead learn the availability of this feature from the current
CouchDB instance and run tests based on that. This effectively
makes the activation automated, which could be controlled
implicitly by either hooking up of a Clouseau instance or not.
- Running the Mango integration tests do not remove the databases
on their completion, which can inadvertently pollute the local
data store. To avoid this, enforce removal of test databases but
allow it to be disabled on demand.
|
|
|
|
|
|
|
|
|
|
| |
Python 3 uses UTF-8 encoding on reading the source files by default
and UTF-8 itself has become more widely adopted in the recent years
therefore it makes sense to remove the associated annotations.
At the same time, it helps to unbreak the Unicode key tests where
the Apple logo ('', as Unicode character) is featured and then got
butchered by forcing the ISO-8859-1 encoding on it.
|
|
|
|
|
|
| |
Text indexes do not support the `$keymapMatch` operator thus let
the test suite know about this limitation to avoid the related
error.
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Various whitespace and formatting fixes.
- Fix the reference to `EUNIT_OPTS`. The variable name has a
typo (it is missing the 'S' from the end) and it is not an
environment variable but a make(1) variable.
- Create subsections of the different kind of tests.
- Update Homebrew home page link.
- Fix Fauxton readme link. The source code for Fauxton now lives
in a separate repository, make the corresponding link reflect
this.
|
| |
|
|
|
|
|
| |
The pattern `{var}` has been established to clarify dynamic
parameters in the documentation. Standardization and clarification
of some not yet converted notation of parameters.
|
|
|
|
| |
Now it is possible to define a JWT roles claim as a comma-seperated
list or as a JSON array of strings (the only allowed old behavior).
|
|
|
|
|
| |
Use `{db}` and `{ddoc}` consistently in paths and titles
Authored-by: @alxndrsn
|
| |
|
|
|
|
|
|
|
| |
- Port some of the missing functionalities: the `xref`, `help`,
`list-eunit-apps`, and `list-eunit-suites` targets.
- Bring the targets about Elixir source code check in sync with
the UNIX version.
|
|
|
|
|
|
|
| |
Due to the double slash in the path that is generated by the
invocation of `find(1)`, the wrong part of the path is going to
be cut. This mistake does not cause trouble for
`list-eunit-suites`, adjusted for consistency only.
|
|
|
|
|
|
| |
The report uploads are still broken and the help message for the
target does not either indicate that is happening. This can be
re-introduced later once fixed.
|
|
|
|
|
|
|
| |
- Turn some of the comments above targets into target descriptions
so that the `help` target could display them.
- Rename `xref` to `find_bugs` as that is the real name.
- Fix rendering of the help message for `install`.
|