We have a server running several processes of Mariadb (10.0.22) and tables running tokudb engine (tokudb-7.5.7) replicating from a master in a normal master-slave setup.
We realised that one of the proceses was lagging a lot found a query that was stuck. The process was completely stuck (stop slave didn't even work, it was just hanging trying to kill the replication thread). The only solution was to kill -9 mysqld.
After migrating the table to InnoDB the problem looks gone.
The full bug report is here: https://bugs.launchpad.net/percona-server/+bug/1621852 but Percona also suggested to get this opened here as it might be something between MariaDB and TokuDB plugin.