summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* doc: 3.3.1-RC2 changes3.3.1.post13.3.1Jan Lehnardt2023-01-061-0/+1
|
* chore: protect 3.3.x and 3.2.x branchesJan Lehnardt2023-01-061-0/+6
|
* Fix replication job start_link.Nick Vatamaniuc2023-01-062-1/+26
| | | | | | | | | | | We don't want to register replication jobs with the module name as that prevents us from running more than one job at a time. This was introduced when we removed the dependence on global registrations and switched to using pg instead. Even more embarrassing is we didn't have tests to check multiple replication jobs running at the same time.
* Fix Ubuntu Jammy CI image referenceNick Vatamaniuc2023-01-061-1/+1
| | | | Just make it use the Erlang 24 version like all the other images
* fix: debuggng leftover, speed up local rebar clonesJan Lehnardt2023-01-061-2/+1
|
* doc(whatsnew): document 3.3.1 updatesJan Lehnardt2023-01-051-0/+15
|
* update version numbers to 3.3.1Jan Lehnardt2023-01-052-2/+2
|
* fix: undefined function warningJan Lehnardt2023-01-051-1/+8
|
* feat: remove failed couch_plugins experimentJan Lehnardt2023-01-059-819/+1
|
* add find_bugs makefile target for undefined functionsRobert Newson2023-01-052-0/+6
|
* Add test coverage for replicator user_ctx parserJay Doane2023-01-051-0/+7
| | | | | | | This adds a test to cover the case when a replication doc contains a user_ctx, and subsequently executes `get_json_value/3`. See: https://github.com/apache/couchdb/pull/4343
* fix undef when parsing replication doc bodyRobert Newson2023-01-051-1/+1
| | | | Closes https://github.com/apache/couchdb-fauxton/issues/1382
* Fix documentation to reflect default_security change3.3.0eanyanwu2022-12-221-6/+10
|
* Update release notes for 3.3.0-RC2Nick Vatamaniuc2022-12-221-0/+23
|
* Fix full CI buildNick Vatamaniuc2022-12-211-2/+0
| | | | | | Don't run erlfmt and elixir format checks We already ran those during the pull request CI phase
* Fix {eaddrnotavail} in elixir tests under WindowsRonny Berndt2022-12-212-3/+15
|
* Ignore built win binaries 2 (#4329)Ronny Berndt2022-12-211-0/+1
|
* Move elixir source checks to a separate stepNick Vatamaniuc2022-12-213-14/+21
| | | | | This is to help unblock 3.3 windows build so make check doesn't choke on re-formatting elixir files for Windows.
* Ignore built win binaries (#4323)Ronny Berndt2022-12-201-0/+3
|
* Write relax-message to standard output on Windows (#4317)Ronny Berndt2022-12-201-1/+1
|
* Reuse installed rebar and rebar3 for mixNick Vatamaniuc2022-12-201-1/+1
| | | | Instead of having it download its own every time
* Revert jiffy to CouchDB-1.0.9-2 to unblock the 3.3 releaseNick Vatamaniuc2022-12-201-1/+1
| | | | | | | Latest jiffy apparently is blocking windows builds so for now let's revert to the previous version. The previous version didn't quite work right off the bat as enc doesn't load on Erlang 25 any longer. So there is a new 1.0.9-2 release wiht enc rebuilt on Erlang 23.
* Return back to allowing offline configure and make releaseNick Vatamaniuc2022-12-194-3/+6
| | | | | | | | | At some point it broke - it looks like rebar3, erlfmt and python-black usage ended up needing the network to install/update themselves. Make sure rebar3 and erlfmt is in bin/ alongside rebar, and make python-black is in a separate source formatting stage step in CI and remove it from `make check`.
* Ensure we use the chttpd vs httpd section in fix_uriNick Vatamaniuc2022-12-171-1/+1
| | | | It's a deprecated feature but we want to make sure it still works.
* Bump version to 3.3.0Nick Vatamaniuc2022-12-162-3/+3
|
* Bump Fauxton to v1.2.9Nick Vatamaniuc2022-12-162-1/+5
|
* Update 3.3 release notes.Nick Vatamaniuc2022-12-162-1/+17
| | | | | | | | | | | | * Since the replicator optimization issues were a bit scattered, create a single parent one as a highlight, and also run somewhat more realistic benchmark tests. * Add an image macro to keep the tradition going. * Update docs section with a 5.3.0 PR which just merged. * Add reference to the newly merged `couchjs -v` enhancement.
* Show version of spidermonkey runtime in couchjs (#4262)Ronny Berndt2022-12-153-2/+28
|
* Update Sphinx to 5.3.0Nick Vatamaniuc2022-12-151-2/+1
|
* docs: add 3.3.0 relese notesJan Lehnardt2022-12-153-2/+374
|
* fix(3517): super-simplistic fix to avoid costly AST transforms when t… (#4292)Jan Lehnardt2022-12-138-8/+92
| | | | | * fix(3517): super-simplistic fix to avoid costly AST transforms when they are not needed Co-authored-by: Ronny Berndt <ronny@apache.org>
* Fix rendering of inline literal with withespaces (#4301)Ronny Berndt2022-12-121-1/+1
| | | | | Fix wrong rendering of an inline literal with whitespaces. Use `:literal` as workaround, with esacpes whitespace `\ ` and added non-break-whitespace chars (U+00A0).
* Add note on how to configure replicaton backoff (#4299)mikhailantoshkin2022-12-121-1/+5
| | | | | | | Documentation was mentioning the exponential backoff on `Crashing` and `Error` states but did not mention how to configure it. This commit adds note on relation of `max_history` and maximum backoff with link to appropriate configuration section.
* Fix a few more flaky smoosh testsNick Vatamaniuc2022-12-081-46/+75
| | | | | | | | | Give up trying to wait on compaction pids, since even if they finished the compaction itself isn't done and swapping hasn't happened yet. Instead just poll db and view sizes until those show a lowered file size. To avoid other channels possibly getting in the way, by default unpausing only the "ratio_dbs" one, and as needed unpause others depending on the test.
* Fix flaky checkpointing smoosh testNick Vatamaniuc2022-12-061-8/+10
| | | | | | This may not be a 100% fix just doing extra asserts that file operations have succeeded and making to wait for the compactor to exit and match the exit reason exactly, to make sure we killed and it does as expected.
* Ensure prevent_overlapping_partitions stays false in Erlang 25+Nick Vatamaniuc2022-12-051-0/+9
| | | | | | | | It's already false in 23 and 24 but will start to be enabled in 25+. We don't rely on global for process registration any more, and have our own auto-connection module. So we don't want to be caught by surprise in Erlang 25+ since there is some additional coordination and resource usage needed when this option is true. See https://github.com/erlang/otp/issues/6470 for an example.
* Fix unbound variable warning (#4289)Ronny Berndt2022-12-051-4/+5
| | | | While the variable `RelativeFileName` is not really unbound in the case-statement, use a more up-to-date pattern for binding the value.
* Allow = in config key namesNick Vatamaniuc2022-12-044-82/+185
| | | | | | | | | | | | They are allowed only for the "k = v" format and not the "k=v" format. The idea is to split on " = " first, and if that fails to produce a valid kv pair we split on "=" as before. To implement it, simplify the parsing logic and remove the undocumented multi-line config value feature. The continuation syntax is not documented anywhere and not used by our default.ini or in documentation. Fix: https://github.com/apache/couchdb/issues/3319
* Increase ddoc_cache test timeoutsNick Vatamaniuc2022-12-021-14/+16
| | | | | | | | | | | | | | | To hopefully fix a flaky test I noticed: ``` module 'ddoc_cache_lru_test' ... ddoc_cache_lru_test:97: with (check_cache_refill)...*failed* ... in function meck_proc:wait/6 (src/meck_proc.erl, line 171) in call from ddoc_cache_lru_test:check_cache_refill/1 (test/eunit/ddoc_cache_lru_test.erl, line 204) in call from eunit_test:run_testfun/1 (eunit_test.erl, line 71) **error:timeout ```
* Add debug logs to smoosh testNick Vatamaniuc2022-12-021-1/+10
| | | | | | Saw this fail 2 in a the last week or so but couldn't reproduce it locally. Instead of deleting, this is an attempt to emit debug lines to see how far it goes before it times out in the CI.
* Remove all usage of globalNick Vatamaniuc2022-12-026-32/+238
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Global has a tendency to create deadlocks [1], and when that happens replication jobs can't start on any of the nodes in the cluster. We don't really need strict consistent locking for replication jobs. It's mostly to avoid replication jobs thrashing the same checkpoint docs back and forth between different session IDs. So, remove global to avoid any issues around it, and replace it with `pg` -- the new (Erlang 23+) process group implementation. (Technically `global` is still running in the runtime system as it's started by the `kernel` app. We just avoid interacting with it and registering any names to avoid deadlocks). In `pg` we start a replication `scope`, and then in that scope make every RepId a process `group`. When replication processes spawn, their Pids becomes `members` of that group: ``` couch_replicator_pg (scope): "a12c+create_target" (RepId group): [Pid1, Pid2] (members) ... ``` As per `pg` implementation, groups are created and remove automatically as members are added/removed from it, so we don't have to do anything there. If there are already any running Pids in the same group, we avoid starting the jobs, and fail like we did before when we used global. In the even more rare case of a race condition, when 2+ jobs do manage to start, we do a membership check before each checkpoint. One of the jobs then stops to yield to another. For simplicity pick the one running on the lowest lexicographically sorted node name to survive. [1] https://github.com/erlang/otp/issues/6524 [2] https://www.erlang.org/doc/man/pg.html
* Improve validation of replicator job parametersNick Vatamaniuc2022-11-3018-861/+1046
| | | | | | | | | | | | | | | | | | | There are two main improvements: * Replace the auto-inserted replicator VDU with a BDU. Replicator already had a BDU to update the `"owner"` field, so plug right into it and validate everything we need there. This way, the validation and parsing logic is all in one module. The previously inserted VDU design doc will be deleted. * Allow constraining endpoint protocol types and socket options. Previously, users could create replications with any low level socket options. Some of those are dangerous and are possible "foot-guns". Restrict those options to a more usable set. In addition to those improvements, increase test coverage a bit by explicitly checking a few more parsing corner cases. Fixes #4273
* Format config filesRonny Berndt2022-11-282-126/+176
| | | | | | | | | | Adjust configuration files to improve readability. Adjust all config keys to use the same pattern (semi-colon w/o ws): ";key = value" Adjust comments (semi-colon with ws): "; My comment description" Added new-line between description and config key, if config-key has a description
* chore: configurable ICU locationsJohannes Jörg Schmidt2022-11-281-1/+3
| | | | | | add `LDFLAGS` and `CFLAGS` environment variables to `IcuEnv` in rebar config to be able to configure ICU includes and object paths via environment variable without having to patch `rebar.config.script`.
* Merge pull request #4275 from apache/node-local-warningRobert Newson2022-11-241-0/+5
|\ | | | | add warning about misapprehending the node-local interface
| * add warning about misapprehending the node-local interfaceRobert Newson2022-11-241-0/+5
|/
* Update smoosh documentationNick Vatamaniuc2022-11-184-76/+74
| | | | | | | | | | | | | | | | * Remove the state chart. With activated/not-activated state gone, we don't need it any longer. * Describe the cleanup channels. * Add upgrade db and view channel references in a few places. * Remove references to `external` or `data_size` and other previous compaction size metrics used for triggering compactions. Replace references with `active` size. * Use double back-ticks in a few places instead of single back-ticks due to differences in RST vs MD. In RST code litterals need double back-ticks.
* Optimize smooshNick Vatamaniuc2022-11-184-713/+1100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clean up, optimize and increase test coverage for smoosh. * Use the new, simpler persistence module. Remove the extra `activated vs non-activated` states. Use `handle_continue(...)` gen_server callback to avoid blocking smoosh application initialization. Then, let channel unpersist in their init function which happens outside general application initialization. * Add an index cleanup channel and enqueue index cleanup jobs by default. * Remove gen_server bottlenecks for status and last update calls. Instead rely on ets table lookups and gen_casts only. * Add a few more `try ... catch`'s to avoid crashing the channels. * Use maps to keep track of starting and active jobs in the channel. * Re-check priority again before starting jobs. This is needed when jobs are un-persisted after restart and database may have been compacted or deleted already. * Update periodic channel scheduled checks to have a common scheduling mechanism. * Quantize ratio priorities to keep about a single decimal worth of precision. This should help with churn in the priority queue where the same db is constantly added and removed for small insignificant ratio changes like 2.0001 -> 2.0002. This works along a recent optimization in smoosh priority queue module, where if priority matches that item is not removed and re-added, it just stays where it is, reducing CPU and heap memory churn. * Remove testing-only API functions to avoid cluttering the API. * Store messages off-heap for channels and smoosh_server. * Instead of a per-channel `last_updated` gen_server:call(...), use a single access ets table which is periodically cleaned from stale entries. As an optimization, before enqueueing the shard, check last access first. This avoids sending an extra message to smoosh_server. * As a protection mechanism against overload, cap the access table size at 250k entries. Don't allow enqueueing more than that many entries during the configured `[smoosh] staleness = Minutes` period. * Increase test coverage from 60% to 90%
* Improve smoosh_priority_queueNick Vatamaniuc2022-11-182-294/+154
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Remove `Value` parameter as it was never used. * Use `make_ref()` instead of `unique_integer([monotonic])` for performance [1]. * Rewrite tests to get 100% coverage. Previous tests didn't actually run due to a setup error. * Switch from `size/1` to `qsize/1` as `size/1` is a built-in and we have to write `?MODULE:size/1` everywhere. * Do not remove elements from the gb_tree just for inspecting min and max elements. * Remove `last_updated/2` logic, as that will be published in an ETS table. * Replace low level file serialization operations with `to_map/1`, `from_map/3`. [1] ``` 4> timer:tc(fun() -> [make_ref() || _ <- lists:seq(1, 1000000)], ok end ). {488923,ok} 6> timer:tc(fun() -> [{erlang:monotonic_time(), erlang:unique_integer([monotonic])} || _ <- lists:seq(1, 1000000)], ok end ). {1178409,ok} ```
* Improve smoosh_utilsNick Vatamaniuc2022-11-183-144/+217
| | | | | | | | | | | | | | | | | | | | Add functions related to dealing with new index cleanup channel. Add functions which fetch the channels list from config. Fix an unfortunate corner case where operators when creating custom smoosh channel may omit by mistake some of the built-in channel like view upgrades. To improve the behavior, make built-in channel always available. Channels configured by the user are always appended to the list of built-in ones. The new validate_arg/1 function is in charge of validation smoosh's input args. It centralizes ?b2l, ?l2b and other transforms and checks in one place so they are not sprinkled throughout the internal functions. After the validation steps all the db and view names are guaranteed to be binaries. The most significant changes is probably addition of extra tests to get to 100% test coverage. Since we cover all of the cases in time window checking, remove the more heavyweight elixir test, since we now get a nice coverage report in Erlang and the test is overall smaller as well.