- Jun 15, 2022
-
-
Yaroslav Dynnikov authored
Just supply it with a default value "demo". No new tests are necessary, we already have `test/int/test_joining.py::test_cluster_id_mismatch`. Close https://git.picodata.io/picodata/picodata/picodata/-/issues/96
-
-
- Jun 06, 2022
-
-
Georgy Moshkin authored
If proc_discover is invoked after raft node was initialized but before raft leader was elected, it would return an error before this commit. Because of that it was impossible to restart the whole cluster at once. This commit change proc_discover such that in case leader_id is not ready, the normal discovery algorithm takes place. Closes #93
-
- Jun 01, 2022
-
-
Sergey V authored
* Make `--cluster-id` CLI mandatory. * Handle cluster_id mismatch in raft_join. When an instance attempts to join the cluster and the instances's `--instance-id` parameter mismatches the cluster_id of the cluster an error is raised inside the raft_join handler.
-
-
- May 31, 2022
-
-
Georgy Moshkin authored
Previously the discovery algorithm would try to reach each known peer sequentially requiring each consequent request to succeed until the next one can be attempted. This would not work in some cases (see test in previous commit). So the new algorithm instead makes a single attempt to reach each peer within a round, and if some failed they're retried in the next round of requests. This allows overall discovery to succeed in cases when some of the initial peers never respond. Closes #54
-
Yaroslav Dynnikov authored
The `peer_address` parameter is an inbound address used for communication with the peer. It shouldn't be confused with the listen address. The persisted `peer_address` may become obsolete due to circumstances beyond picodata control (e.g. DNS or IP changes). Thus there's no point in its prior validation, including the uniqueness check. There's also no such task as getting peer by peer_address. To sum up, an index over `peer_address` is useless. It only creates problems and causes panics. Close https://git.picodata.io/picodata/picodata/picodata/-/issues/88
-
- May 30, 2022
-
-
-
Yaroslav Dynnikov authored
Picodata already assigns `replicaset_id` to an instance when it joins, but it wasn't used in Tarantool `box.cfg` yet. Now it is. It's also important to set up listen port in `start_join` immediately. Without it Tarantool will stuck waiting for connection to self. Part of https://git.picodata.io/picodata/picodata/picodata/-/issues/52
-
-
- May 26, 2022
-
-
Yaroslav Dynnikov authored
-
Yaroslav Dynnikov authored
It's already formatted in conformity to usual `cargo test`. Also, remove unused command-line arguments from `picodata test` command. Close https://git.picodata.io/picodata/picodata/picodata/-/issues/61
-
- May 23, 2022
-
-
Yaroslav Dynnikov authored
When bootstrapping an instance, there're two possible execution paths - `start_boot` and `start_join`. While `start_join` takes all uuids from JoinResponse, `start_boot` already deals with a bootstrapped `box.cfg` (it's done in `start_discover`, refer to [1]). In order to make uuids consistent across `box.cfg` and topology module, `start_boot` stage is preceded with rebootstrap. This case is also covered with a pytest. - [1] doc/clustering.md
-
Yaroslav Dynnikov authored
- Add corresponding field to the Peer struct. - Generate it in the topology module. - Use it in `box.cfg`. Close https://git.picodata.io/picodata/picodata/picodata/-/issues/51
-
Yaroslav Dynnikov authored
Address `replication_factor` when choosing `relicaset_id` for a new instance. It dosn't consider `failure_domain` yet, but takes into account the number of instances. Close https://git.picodata.io/picodata/picodata/picodata/-/issues/68
-
Yaroslav Dynnikov authored
- Choose it in the topology module if it's not provided in a `JoinRequest`. - Persist in `raft_group` space. - Respond with an error if `JoinRequest` contains different `replicaset_id`. - In `JoinResponse` it's transferred automatically. Part of https://git.picodata.io/picodata/picodata/picodata/-/issues/51
-
Yaroslav Dynnikov authored
- Generate it in the topology module - Persist it in `raft_group` space - Transfer it in `JoinResponse` - Use it in `box.cfg` Close https://git.picodata.io/picodata/picodata/picodata/-/issues/50
-
- May 21, 2022
-
-
Yaroslav Dynnikov authored
It's necessary to incapsulate topology management logics away from main.
-
Yaroslav Dynnikov authored
It encapsulates the logics of a JoinRequest batch processing. Topology module will be quite important in picodata. This first version misses a lot of features, but a few commits later it's going to implement quite a lot of logics. When a new instance is joined - there's one complex thing: raft leader has to decide where this new instance is going to be emplaced, i.e. what replicaset should it join. There're many different parameters have an influence - `repliction_factor`, `failure-domain`, and of course the existing topology. So, this new `topology` module must make the decision. This patch only refactors the current Picodata behavior, and doesn't bring new features for its users. Instead, it opens the door to a future development. Also, this patch provides a unit-testing basis for the future features.
-
- May 20, 2022
-
-
Yaroslav Dynnikov authored
Both JoinRequest and JoinResponse are going to be used in other modules. Move them one level above from `traft::node::*` to `traft::*`.
-
Yaroslav Dynnikov authored
One of the most tricky Raft cases is a so-called ABA problem [1]. In that case it's important to protect a batch of join requests with a term number. Since the whole batch is supplied with atomicity-sensitive uuids, applying it on a different term may cause an inconsistency, which is very, veeeery bad. [1] https://en.wikipedia.org/wiki/ABA_problem
-
- May 17, 2022
-
-
This patch covers one more case when discovery request is handled by an instance that has the discovery module unitialized.
-
- May 16, 2022
-
-
Yaroslav Dynnikov authored
By default cargo runs tests in parallel in multiple threads. Both `test_log_level` and `test_parse` access environment variables which are shared across threads. Consequently, their concurrent modification results in the test failure. This patch unites these two tests making it linear.
-
- May 13, 2022
-
-
- May 12, 2022
-
-
Yaroslav Dynnikov authored
1. Lower log level of connection errors in `netork.rs`. 2. Give raft fibers a name.
-
Yaroslav Dynnikov authored
There were some problems with join requests synchronization. Raft forbids proposing a configuration change if there's another one uncommitted (see [1]). In that case, it replaces an `EntryConfChange` with an `EntryNormal`. It could happen at any time even without bugs in code due to the network partitioning, and its the repsonsibility of the picodata product to handle it properly. Earlier, there was no way to wait when raft leaves the joint state. It used to slow down cluster assembling and made it race-prone. The waiting for the cluster readiness is also important in tests. Some operations (the most important amongst them is leader switching) are impossible until instance finishes promotion to a voter. For instance, raft rejects `MsgTimeoutNow` unless the node is promotable (see [2]). It makes some testing scenarios flaky. This patch introduces new synchronization primitive - `JointStateLatch`. The latch is held on the leader and is locked upon `raw_node.propose_conf_change()`. It's unlocked only when the second (implicit) conf change that represents leaving joint state is committed. The latch also tracks the index of the corresponding `EntryConfChange`. Even if raft ignores it for any reason, the latch is still unlocked as soon as the committed index exceeds the one of the latch. [1] https://github.com/tikv/raft-rs/blob/v0.6.0/src/raft.rs#L2014-L2026 [2] https://github.com/tikv/raft-rs/blob/v0.6.0/src/raft.rs#L2314 Close https://git.picodata.io/picodata/picodata/picodata/-/issues/47 Close https://git.picodata.io/picodata/picodata/picodata/-/issues/53
-
Yaroslav Dynnikov authored
Waiting for a valid `leader_id` on a node isn't enough. It may already have one, but still be a Learner. Instead, the fixture should wait until the node is promoted to voter.
-
- May 08, 2022
-
-
Yaroslav Dynnikov authored
-
- Apr 27, 2022
-
-
Yaroslav Dynnikov authored
-
Yaroslav Dynnikov authored
-
Georgy Moshkin authored
-
- Apr 26, 2022
-
-
Georgy Moshkin authored
-
- Apr 24, 2022
-
-
Yaroslav Dynnikov authored
We don't want a child process to live without the supervisor. Usually, supervisor waits for child forever and retransmits termination signals. But if the parent is killed with a SIGKILL there's no way to pass anything. This patch supplies a child process with a `supervisor_fuse` fiber. It tries to read from a pipe (that supervisor never writes to), and if the writing end is closed, it means the supervisor has terminated. In this case, child process terminates too. Part of https://git.picodata.io/picodata/picodata/picodata/-/issues/56
-
Yaroslav Dynnikov authored
This patch reduces the variable passing trace length. Instead of returning it from function to function, call `exit()` in place. The trace of exit code before the patch: ``` exit() <- main <- main_run <- fork(child) <- tarantool_main ``` And now: ``` exit() <- tarantool_main ``` Type safety is ensured at comilation time by using `!` type for `fn main()`. See https://doc.rust-lang.org/reference/types/never.html
-
Yaroslav Dynnikov authored
-
-
Yaroslav Dynnikov authored
```console $ cargo clippy Compiling picodata v0.1.0 (/home/rosik/w/picodata) warning: 'tarantool-sys/patches-applied' exists, so patching step is skipped warning: single-character string constant used as pattern --> src/args.rs:194:47 | 194 | let (host, port) = match text.rsplit_once(":") { | ^^^ help: try using a `char` instead: `':'` | = note: `#[warn(clippy::single_char_pattern)]` on by default = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern warning: called `cloned().next()` on an `Iterator`. It may be more efficient to call `next().cloned()` instead --> src/discovery.rs:154:27 | 154 | let res = peers.difference(&self.visited).cloned().next(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `peers.difference(&self.visited).next().cloned()` | = note: `#[warn(clippy::iter_overeager_cloned)]` on by default = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_overeager_cloned warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/ipc.rs:27:9 | 27 | / match rmp_serde::encode::write(&mut self.fd, msg) { 28 | | Err(e) => tlog!(Error, "ipc error: {e}"), 29 | | Ok(()) => (), 30 | | } | |_________^ help: try this: `if let Err(e) = rmp_serde::encode::write(&mut self.fd, msg) { tlog!(Error, "ipc error: {e}") }` | = note: `#[warn(clippy::single_match)]` on by default = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match warning: `picodata` (bin "picodata") generated 3 warnings Finished dev [unoptimized + debuginfo] target(s) in 1.41s ```