/gossip-glomers-scala

https://fly.io/blog/gossip-glomers/

Primary LanguageScala

Development

Uses nvim-metals (and its embedded millw) together with mill.

Building and running

Generate JAR

 ./.metals/millw Glomers.assembly

Show folder keeping the generated JAR

./.metals/millw show Glomers.assembly

Run the app

./out/Glomers/assembly.dest/out.jar

Tests

This project uses the FunSuite from scalatests (since that seems to be the one used in the Databricks codebase).

To run the Tests

./.metals/millw Glomers.test

To run the tests in watch mode

./.metals/millw --watch Glomers.test

Glomers

Note that the commands in the following sections assume that you have a local copy of maelstrom in the same folder as this project.

Echo

Challenge#1 Echo

./maelstrom/maelstrom test -w echo --bin out/Glomers/assembly.dest/out.jar --time-limit 10

Unique id

Challenge #2: Unique ID Generation

./maelstrom/maelstrom test -w unique-ids --bin out/Glomers/assembly.dest/out.jar --time-limit 30 --rate 1000 --node-count 3 --availability total --nemesis partition

Broadcast

Challenge #3a: Single-Node Broadcast

./maelstrom test -w broadcast --bin ~/go/bin/maelstrom-broadcast --node-count 1 --time-limit 20 --rate 10

Challenge #3b: Multi-Node Broadcast

On this iteration of the glomer I create node ensembles. Each node ensemble has a head (or leader). The messages can flow from non-leader nodes to their leader, from the leader of an ensemble to the rest of the nodes in the ensemble and from a leader to its previous and next leader. Nodes from different ensembles can't communicate with each other.

GLOMER=broadcast ./maelstrom/maelstrom test -w broadcast --bin out/Glomers/assembly.dest/out.jar --node-count 5 --time-limit 20 --rate 1

Challenge #3c: Fault Tolerant Broadcast

On this iteration of the glomer I use a quite simple approach to guarantee message delivery. For each message delivered to another node in a node ensemble I keep track of it until I receive a delivery confirmation deliver_broadcast_ok. While the confirmation is not received I keep sending the message.

GLOMER=broadcast ./maelstrom/maelstrom test -w broadcast --bin out/Glomers/assembly.dest/out.jar --node-count 5 --time-limit 20 --rate 10 --nemesis partition