Master-Master replication MariaDB failover resync
I would recommend to upgrade to MariaDB 10.0 and use Global Transaction IDs. Replication isn't crash safe in 5.5, so you might encounter issues such as the one you've described above.