summaryrefslogtreecommitdiff
path: root/src/rexi
Commit message (Collapse)AuthorAgeFilesLines
* Delete unused include_lib attributesJay Doane2023-01-111-3/+0
| | | | Thanks, LSP!
* Enable eunit coverage for all applicationsJay Doane2022-09-281-4/+0
| | | | | | Enable eunit test coverage for all applications via top level rebar.config.script, and remove redundant configuration at the application level.
* Add editors magic linesNoah Shaw2022-07-281-0/+2
|
* Remove Erlang < 23 ifdefs and other macrosNick Vatamaniuc2022-06-171-16/+29
|
* Removed unused include filesNick Vatamaniuc2022-05-191-2/+0
| | | | | Emacs + erlang_ls noticed those. There may be more, but didn't know how systematically check all of the files.
* Default rexi use_kill_all to trueNick Vatamaniuc2022-05-191-5/+4
| | | | | | | | | It should save some dist bandwidth when workers are canceled at the end of fabric requests. The feature has been available since 3.0.x (3 years ago) so opt to enable it by default. Users who do a rolling upgrade from 2.x could still set it to `false` and then, after the upgrade completes, delete it to return it to default (true).
* Apply erlfmt formatting to source treeNick Vatamaniuc2021-11-229-248/+263
| | | | | | | | | | | | | | | | | | | | | | | | | | | These exceptions from main were ported over to 3.x ``` --- a/src/chttpd/src/chttpd.erl +++ b/src/chttpd/src/chttpd.erl @@ -491,6 +491,7 @@ extract_cookie(#httpd{mochi_req = MochiReq}) -> end. %%% end hack +%% erlfmt-ignore set_auth_handlers() -> AuthenticationDefault = "{chttpd_auth, cookie_authentication_handler}, ``` ``` --- a/src/couch/src/couch_debug.erl +++ b/src/couch/src/couch_debug.erl @@ -49,6 +49,7 @@ help() -> ]. -spec help(Function :: atom()) -> ok. +%% erlfmt-ignore help(opened_files) -> ```
* feat: work around get_stacktrace deprecation/removalJan Lehnardt2021-03-171-5/+7
| | | | | | | | | | | This patch introduces a macro and inserts it everywhere we catch errors and then generatre a stacktrace. So far the only thing that is a little bit ugly is that in two places, I had to add a header include dependency on couch_db.erl where those modules didn’t have any ties to couchdb/* before, alas. I’d be willing to duplicate the macros in those modules, if we don’t want the include dependency.
* Make the rexi:stream2 interface unacked message limit configurable (#2360)Kyle Snavely2020-01-071-2/+3
| | | | | | | | Also lower the default stream_limit to 5 based on the results of performance testing. Co-authored-by: Adam Kocoloski <kocolosk@apache.org> Co-authored-by: Kyle Snavely <kjsnavely@gmail.com>
* Use individual rexi kill messages by defaultNick Vatamaniuc2019-05-011-6/+18
| | | | | | | | | | | When performing a rolling upgrade older nodes won't be able to handle newer kill_all messages. In busy clusters this could cause couch_server and other message queue backups while the upgrade is in progress. Make message sending behavior is configurable. After all the nodes have been upgraded, can toggle `[rexi] use_kill_all = true` to save on some inter-node network traffic. In a future release the configuration check might be removed, default to sending kill_all messages only.
* Uneven shard copy handling in mem3 and fabricNick Vatamaniuc2019-04-032-10/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The introduction of shard splitting will eliminate the contraint that all document copies are located in shards with same range boundaries. That assumption was made by default in mem3 and fabric functions that do shard replacement, worker spawning, unpacking `_changes` update sequences and some others. This commit updates those places to handle the case where document copies might be in different shard ranges. A good place to start from is the `mem3_util:get_ring()` function. This function returns a full non-overlapped ring from a set of possibly overlapping shards. This function is used by almost everything else in this commit: 1) It's used when only a single copy of the data is needed, for example in cases where _all_docs or _changes procesessig. 2) Used when checking if progress is possible after some nodes died. `get_ring()` returns `[]` when it cannot find a full ring is used to indicate that progress is not possible. 3) During shard replacement. This is pershaps the most complicated case. During replacement besides just finding a possible covering of the ring from the set of shards, it is also desirable to find one that minimizes the number of workers that have to be replaced. A neat trick used here is to provide `get_ring` with a custom sort function, which prioritizes certain shard copies over others. In case of replacements it prioritiezes shards for which workers have already spawned. In the default cause `get_ring()` will prioritize longer ranges over shorter ones, so for example, to cover the interval [00-ff] with either [00-7f, 80-ff] or [00-ff] shards ranges, it will pick the single [00-ff] range instead of [00-7f, 80-ff] pair. Co-authored-by: Paul J. Davis <davisp@apache.org>
* Remove explicit modules list from .app.src filesJay Doane2018-12-271-10/+0
| | | | | | The modules lists in .app files are automatically generated by rebar from .app.src files, so these explicit lists are unnecessary and prone to being out of date.
* Make sure to start per-node rexi servers right awayNick Vatamaniuc2018-10-021-0/+2
| | | | | | | | | | | | | This ensures they will be ready to process requests as soon as the application starts up. This should make the service available sooner and should help tests which setup and tear down the services repeatedly, where it would avoid an annoying retry-until-ready loop. Per-node servers/buffers are started in the init method of the monitors. There is not chance of deadlock there because per-node supervisors are started before the monitors. Issue #1625
* Switch rexi server_per_node to true by defaultNick Vatamaniuc2018-10-021-2/+2
| | | | | | | This has been solid for years and when not enabled can be a performance bottleneck. Fixes #1625
* Allow disabling off-heap messagesNick Vatamaniuc2018-09-061-1/+1
| | | | | | | | | | | | | | Off-heap messages is an Erlang 19 feature: http://erlang.org/doc/man/erlang.html#process_flag_message_queue_data It is adviseable to use that setting for processes which expect to receive a lot of messages. CouchDB sets it for couch_server, couch_log_server and bunch of others as well. In some cases the off-heap behavior could alter the timing of message receives and expose subtle bugs that have been lurking in the code for years. Or could slightly reduce performance, so a safety measure allow disabling it.
* Switch rexi_sup restart strategy to rest_for_oneNick Vatamaniuc2018-08-221-1/+1
| | | | | | | | | | | | | | | | | | Previously, as described in issue #1571, `rexi_server_sup` supervisor could die and restart. After it restarts `rexi_server_mon` would not respan rexi servers as it wouldn't notice `rexi_server_sup` went away and come back. That would leave the cluster in a disabled state. To fix the issue, switch restart strategy to `rest_for_one`. In this case, if a child at the top dies it will restart all the children below it in the list. For example, if `rexi_server` dies, it will restart all the children. If `rexi_server_sup` dies, it will restart `rexi_server_mon`. And then on restart `rexi_server_mon` will properly spawn all the rexi servers. Same for the buffers, if `rexi_buffer_sup` dies, it will restart `rexi_buffer_mon` and on restart it will spawn buffers as expected. Fixes: #1571
* Add rexi ping messageGarren Smith2018-08-082-0/+11
| | | | | | | Add a ping message to rexi to avoid any long running operations from timing out. Long running operations at the node level can exceed the fabric timeout and be cancelled. Sending a ping message back will stop that from happening.
* Call `set_mqd_off_heap` for critical processesPaul J. Davis2018-06-191-0/+1
| | | | | | This uses the new `couch_util:set_mqd_off_heap/0` function to set message queues to off_heap for some of our critical processes that receive a significant amount of load in terms of message volume.
* Add coverage reports to more applicationsNick Vatamaniuc2017-12-111-0/+2
|
* Fix erlang time module compatibilityNick Vatamaniuc2017-10-101-1/+1
| | | | | | | | | | | | | | | | | | | `now/0` is deprecated since Erlang 18.0, and a set of new time related functions are available. Usually `now/0` can be replaced with `os:timestamp/0`, however in some instances it was used effectively to produce monotonically incrementing values rather than timestamps. So added a new `couch_util:unique_monotonic_integer/0`. Most functional changes are in couch_uuid module. There `now/0` was used both as a timestamp and for uniqueness. To emulate previous behavior, a local incrementing clock sequence is used. If `os:timestamp/0` does not advance since last call then the local clock is advanced by 1 microsecond and that's used to generate the next V1 UUIDs. As soon as os:timestamp/0` catches up, the local sequence reset to that latest value. Also exported function `utc_random/0` was not used, after updating the function it wasn't exported anymore.
* Do not buffer rexi messages to disconnected nodesNick Vatamaniuc2017-09-251-20/+64
| | | | | | | | | | | | | | | | | | | Instead wait 15 seconds after last cluster configuration change, if there were no more changes to the cluster, stop rexi buffers and servers for nodes which are no longer connected. Extract and reuse cluster stability check from `couch_replicator_clustering` and move it to `mem3_cluster` module, so both replicator and rexi can use it. Users of `mem3_cluster` would implement a behavior callback API then spawn_link the cluster monitor with their specific period values. This also simplifies the logic in rexi_server_mon as it no longer needs to handle `{nodeup, _}` and `{nodedown, _}` messages. On any cluster membership change it will get a `cluster_unstable` message. It then immediately spawns new servers and buffers if needed. Only when cluster has stabilized it will stop servers and buffers for disconnected nodes. The idea is to allow for short periods of disconnects between nodes before throwing away all the buffered messages.
* Use fully qualified call to allow code upgradeILYA Khlopotov2017-08-181-1/+2
| | | | | | rexi_monitor:wait_monitor function is called recursivelly. This means that hot code upgrade will not work when we are inside that function. Use fully qualified call to allow the update of a module.
* Log additional information on crashes from rexiILYA Khlopotov2017-08-141-1/+5
|
* Add 'src/rexi/' from commit 'a327b7dbeb2b0050f7ca9072047bf8ef2d282833'Jan Lehnardt2017-04-0113-0/+1085
git-subtree-dir: src/rexi git-subtree-mainline: 81ad7005d01fbc03bd7573aaa97f0b44c137e6c3 git-subtree-split: a327b7dbeb2b0050f7ca9072047bf8ef2d282833