Mantle with `vstart.sh`
-~~~~~~~~~~~~~~~~~~~~~
+~~~~~~~~~~~~~~~~~~~~~~~
1. Start Ceph and tune the logging so we can see migrations happen:
Output
-~~~~~
+~~~~~~
Looking at the log for the first MDS (could be a, b, or c), we see that
everyone has no load:
MDSMap tells the MDSs which balancer to use.
Exposing Metrics to Lua
-~~~~~~~~~~~~~~~~~~~~~~
+~~~~~~~~~~~~~~~~~~~~~~~
Metrics are exposed directly to the Lua code as global variables instead of
using a well-defined function signature. There is a global "mds" table, where
cpu_load_avg.
Compile/Execute the Balancer
-~~~~~~~~~~~~~~~~~~~~~~~~~~~
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Here we use `lua_pcall` instead of `lua_call` because we want to handle errors
in the MDBalancer. We do not want the error propagating up the call chain. The
leveraged here because the balancer is invoked every 10 seconds by default.
Returning Policy Decision to C++
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
We force the Lua policy engine to return a table of values, corresponding to
the amount of load to send to each MDS. These loads are inserted directly into
come to the same decision at the same time (e.g., importers, exporters, etc.).
Debugging
-~~~~~~~~
+~~~~~~~~~
Logging in a Lua policy will appear in the MDS log. The syntax is the same as
the cls logging interface:
the `ceph -w` utility. These messages are used for the integration tests.
Testing
-~~~~~~
+~~~~~~~
Testing is done with the ceph-qa-suite (tasks.cephfs.test_mantle). We do not
test invalid balancer logging and loading the actual Lua VM.