Repository navigation
clusterer_controller: zero-config HA clusterer control module with automatic sharing tag management via encrypted UDP multicast - #4074
Conversation
|
Thank you very much for the contribution, I really like the idea behind it. I do see though that it is marked as a Draft - is it still work in progress, or has it reached to its final state? Let us know when it is ready to review. |
This comment has been minimized.
This comment has been minimized.
2cf5b36 to
34f1042
Compare
This comment has been minimized.
This comment has been minimized.
f93b82d to
4348580
Compare
This comment has been minimized.
This comment has been minimized.
82e123e to
b7a173e
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
aad3a24 to
5dc976d
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
dd0f515 to
22cb916
Compare
a129c83 to
ba76f92
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
49477ae to
30beae7
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Hi, @Lt-Flash ! Once again, thank you for your contribution, it is truly appreciated. This is a very interesting topic for us! Best regards, |
|
Hi Răzvan, Thank you - that is great news, and I am glad the topic is interesting for you! Yes, it is doable, and I like the direction: a single module in To make sure I understood you correctly, this is what I plan:
The module would be loaded instead of clusterer, not next to it. Two questions:
Thank you again for your time and for the support! |
The changes PR OpenSIPS#4074 makes to modules/clusterer behind CLUSTERER_CTRL_SUPPORT, with that switch resolved as defined: the controller API (clusterer_ctrl.c/h), per-cluster node ids, the managed sharing tags and BIN messages that do not override the controller. Log and MI strings are ASCII where the PR had em dashes.
PR OpenSIPS#4074's tests (netns suite with its groups, the real-cluster tests, the unit tests and the consumer rigs), loading clusterer_controller.so alone; the controller's parameters and MI commands are clusterer's now.
bc2c8ac to
e41909b
Compare
|
Hi @razvancrainea, Thank you again for accepting the module! I have updated this PR as you asked: Two questions, as the PR still has a few changes outside the module, each in its own commit:
Happy to split either of them out - please let me know if you would like anything else changed. |
f4929be to
71ee0a8
Compare
register_module() kept the pointer it was given, and load_module() passes its search buffer, which it cuts back to the bare directory once a module loads - so every module's path read as its mpath directory. The path is now copied, in the same allocation as the module.
'opensips -T <module>' looked the module up by its registered name only, so a module registering under another name than its file's - such as clusterer_controller.so, which registers as clusterer - was reported as not loaded. It now falls back to the module loaded from <module>.so.
…s modules Since f79c98b the %files line of opensips-modules-contrib sat inside the main package's file list in the RPM spec, so every module and README listed after it (acc.so to README.usrloc) went into opensips-modules-contrib instead of opensips. It now follows that list.
tm read clusterer's node id once, at mod_init, and stamped it into the cid Via parameter of every request. When a controller assigns node ids, the id is set after mod_init and can change, so it is read per request instead: no cid until the node has an id, then the live one, and a reply's cid is checked against the live id. With a static clusterer the id never changes and nothing differs.
…ib module modules/clusterer as it is on master, in modules-contrib/clusterer_controller, built as clusterer_controller.so and otherwise unchanged - it keeps the module name clusterer, so the modules that depend on clusterer, and the configs that set its parameters, work with it unchanged. The next commit reads as a diff against clusterer.
71ee0a8 to
f2d52f9
Compare
|
A short note on why this update reworks clusterer_controller this much. In my tests the version in this PR could not form a large cluster: 32 nodes started at once on one VM never settled, and even with the master admitting joiners a few at a time, clusterer's ping and link-state layer flooded itself at 64 nodes and the cluster did not form in any of three runs. So controller-managed clusters now get an admission step, a multicast heartbeat in place of clusterer's pings, link-state floods and relaying, and module broadcasts over multicast. With that, 64 nodes started at once form in about two minutes. Clusters without |
f2d52f9 to
7aa859f
Compare
|
I have pushed an update: still the same 6 commits, and only the last one, the module itself, changed. New tests and a second round of measurements found these, now fixed:
Also: a joiner still connecting after 60 s is parked, so the admission queue moves on; a node coming online resyncs every capability, not only the first 16; the paths for members without the probe, admission or maintenance capabilities are gone, as every build of wire version 4 has them; and new network-namespace tests cover a 2-2 split, two members cut from each other, the master killed during an admission, and parking. The description has the new measurements: 64 nodes started at once formed in 10 runs of 10, 128 nodes in about four and a half minutes, and replication at 10% loss and with reordering. |
The nodes of a cluster declared with cluster_options use_controller=1 find each other over encrypted IPv4 multicast, elect a master, receive their node ids and BIN addresses from it, and fail the cluster's sharing tags over; every other cluster behaves as with clusterer. A master that most members cannot hear steps down, its sharing tags in backup, until a master hears it again. clusterer's side (per-cluster node ids, controller-managed clusters and sharing tags, BIN messages that cannot override the controller) is in clusterer's files, the controller's own code in cl_ctr_*. Loading clusterer.so beside it is refused. The master admits joiners a few at a time and holds each one CONNECTING, with no role or sharing tag, until its BIN links to every member are up both ways; a joiner stuck there is named with the pairs that are down, and parked after 60 s so that the queue moves on past it. Every member multicasts a heartbeat each second with its links and capability states, so liveness and node events come from heartbeats and links, with no periodic BIN pings, no link-state floods and no routing through other nodes. Module broadcasts go out as one multicast datagram (fragments when larger), numbered per sender, repaired by unicast and ordered with the TCP messages that follow them; what cannot be repaired is reported, and the sender goes down and up to this node's modules, which sync again. Wire version 4. With its unit, network-namespace and real-cluster tests, the packages (opensips-module-contrib-clusterer-controller), the README, an overview diagram, the measurements (doc/benchmarks.md), and libsodium in the CI build dependencies.
|
Hi, @Lt-Flash ! Thank you for this amazing work! It's ok to have the tm change inside this PR, no worries! Just to double check, currently we can not run with both Best regards, |
7aa859f to
2f5a2f2
Compare
|
I have pushed an update: still the same 6 commits, and only the last one, the module itself, changed.
New tests: a node whose outgoing multicast is cut, as a member and as the master, and a unit test with three readers, a TCP sender and the broadcast tick running at once. The measurements moved from the description to |
|
Hi @razvancrainea, thank you! Both modules in one instance: right, they cannot run side by side - both register as tm with |
Summary
This PR adds
clusterer_controller, a contrib module that is clusterer with one extra ability: the nodes of a cluster find each other on their own. Give every node the same multicast group, cluster id and password, and they elect a master, which gives each node its node id, tells the others its BIN address and moves the sharing tags when a node goes away. The README has the details and an overview diagram, and doc/benchmarks.md the measurements.Details
use_controller=1); every other cluster behaves exactly as with clusterer.Solution
In a controller-managed cluster:
Compatibility
cidper request instead of once at startup, as the controller assigns it at runtime. With clusterer nothing differs.Closing issues
None.