summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* capture original stack tracemore-couch-index-server-goopRobert Newson2023-03-221-7/+20
|
* don't log the expected caseRobert Newson2023-03-221-0/+2
|
* Merge pull request #4485 from apache/couch_index_crashesRobert Newson2023-03-211-1/+5
|\ | | | | catch and log any error from mem3:local_shards
| * catch and log any error from mem3:local_shardsRobert Newson2023-03-211-1/+5
|/
* docs(typo): Fix server name duplicate (#4484)Ronny Berndt2023-03-211-1/+1
|
* feat: add type and descriptions to prometheus output (#4475)Will Holley2023-03-202-51/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 configure settings to Windows (#4479)Ronny Berndt2023-03-171-0/+6
| | | | Migrate the settings `with_proper` and `erlang_md5` to `configure.ps1` to add it to `config.erl`.
* Improve couch_js_testsNick Vatamaniuc2023-03-161-60/+111
| | | | | | | | | | | | | | | | | | | | | | | | | 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 ... ```
* fix: prometheus counter metric naming (#4474)Will Holley2023-03-142-73/+77
| | | | | | | | | | | | | | | | `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`
* Fix list ordering and indentation in "Search" docs (#4476)Ronny Berndt2023-03-131-46/+44
|
* Avoid re-compiling filter view functionsNick Vatamaniuc2023-03-133-8/+6
| | | | | | | | | | | | | 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.
* fix: remove duplicate couchdb_erlang* from _prometheusWill Holley2023-03-132-2/+17
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* Prepare for Erlang OTP/26 (#4465)Ronny Berndt2023-03-111-1/+1
|
* Remove stale links from documentation commentsGabor Pali2023-03-101-6/+1
|
* Modify conflict ruby examplejiahuili2023-03-101-42/+57
| | | | | | - 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: correct text index selection for queries with `$regex` (#4458)PÁLI Gábor János2023-03-106-22/+666
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* Bump snappy to CouchDB-1.0.9 (#4464)Ronny Berndt2023-03-101-1/+1
|
* Fix erlfmt-format on Windows (#4463)Ronny Berndt2023-03-092-4/+4
| | | The erlfmt executable likes POSIX paths on Windows too.
* Tweak formatting and style of `_find` API documentation (#4460)PÁLI Gábor János2023-03-091-89/+97
| | | | | | | | | | | | | | | | | | | | | | | 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.
* Improve documentation of source code format checksGabor Pali2023-03-093-8/+17
| | | | | | | | | - 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.
* Documentation: Add `adm:pass` to replication endpoint URL (#4457)Jiahui Li2023-03-064-60/+65
| | | | | | | 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>
* Remove duplicate parts of doc note (#4455)Ronny Berndt2023-03-061-2/+1
|
* Fix flaky elixir users_db_testsNick Vatamaniuc2023-03-041-2/+6
| | | | | | | | 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
* Fix flaky LRU testNick Vatamaniuc2023-03-041-0/+6
| | | | | | | | | | | | 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
* Fix bad prometheus section nameNick Vatamaniuc2023-03-043-1/+5
| | | | | | | | | | | | | 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
* Only allow POST request for /{db}/_view_cleanup (#4449)Ronny Berndt2023-03-021-2/+4
|
* This enables configuring FIPS mode at runtime without the need for a custom ↵Nick Vatamaniuc2023-02-276-12/+107
| | | | | | build. Issue: #4442
* Use persistent terms for featuresNick Vatamaniuc2023-02-271-15/+15
| | | | This is intended to speed up feature checks.
* Update last_check in file logger recordRami Alia2023-02-261-2/+5
|
* add a notice that purge documents are only visible with `include_system=true`Christian Kruse2023-02-241-2/+4
|
* add tests to cover hiding resp showing system docsChristian Kruse2023-02-241-0/+198
|
* inspect the document more precisely to avoid skipping user docsChristian Kruse2023-02-241-5/+22
|
* hide shard-sync and purge documents from `_local_docs`Christian Kruse2023-02-242-31/+47
| | | | | | It hides the shard-sync and purge documents from the response unless a `?include_system=true` is given. Fixes #3930
* Update Erlang 24 for CINick Vatamaniuc2023-02-242-2/+2
| | | | Multi-arch images were updated in https://hub.docker.com/r/apache/couchdbci-debian/tags
* Unifying the notation of dynamic parameters in the docs 2 (#4441)Ronny Berndt2023-02-233-4/+4
| | | | The pattern {var} has been established to clarify dynamic parameters in the documentation. Standardization and clarification of some not yet converted notation of parameters.
* Show ini code-block correctly (#4440)Ronny Berndt2023-02-231-1/+1
|
* Upgrade hash algorithm for proxy auth (#4438)Ronny Berndt2023-02-234-17/+117
| | | | Proxy auth can now use one of the configured hash algorithms from chttpd_auth/hash_algorithms to decode authentication tokens.
* Consolidate Mango integration testsGabor Pali2023-02-215-54/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* mango: switch to UTF-8 encoding for every testGabor Pali2023-02-214-4/+0
| | | | | | | | | | 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.
* mango: skip the `$keymapMatch` test for text indexesGabor Pali2023-02-211-0/+4
| | | | | | Text indexes do not support the `$keymapMatch` operator thus let the test suite know about this limitation to avoid the related error.
* Fix and extend developer instructionsGabor Pali2023-02-211-33/+54
| | | | | | | | | | | | - 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.
* Fix typo in "feature_flags" section comment (#4433)Ronny Berndt2023-02-201-2/+2
|
* Unifying the notation of dynamic parameters in the docs (#4436)Ronny Berndt2023-02-207-11/+11
| | | | | The pattern `{var}` has been established to clarify dynamic parameters in the documentation. Standardization and clarification of some not yet converted notation of parameters.
* Allow definition of JWT roles claim as comma-seperated list (#4431)Ronny Berndt2023-02-204-4/+72
| | | | 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).
* docs/api: use {params} consistently in titles (#4426)Alex Anderson2023-02-1719-121/+123
| | | | | Use `{db}` and `{ddoc}` consistently in paths and titles Authored-by: @alxndrsn
* Fix typoGabor Pali2023-02-161-1/+1
|
* Overhaul the Windows MakefileGabor Pali2023-02-161-11/+33
| | | | | | | - 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.
* Fix the `list-eunit-apps` targetGabor Pali2023-02-161-2/+2
| | | | | | | 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.
* Remove the inactive uploader action from `build-report`Gabor Pali2023-02-161-1/+0
| | | | | | 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.
* Clean up `make help` outputGabor Pali2023-02-161-6/+10
| | | | | | | - 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`.