Lavalink Infrastructure
Failover & Node Maintenance
Automated session migration, health check timeouts, and zero-downtime rolling maintenance workflows.
In traditional Lavalink configurations, taking down a server for a security update or kernel patch abruptly terminates all active music players on that machine. The Musiva Lavalink Gateway introduces automated failover and rolling maintenance capabilities.
The Failover Lifecycle
When an active node becomes unhealthy or loses connectivity to Discord:
Rendering diagram...
- Heartbeat Detection: The Gateway sends lightweight WebSocket pings to each registered node. If a node fails to respond within the configured timeout window, it is flagged as
Degraded. - Session Evacuation: Active player states (track URI, position offset, volume, and active filters) are synchronized.
- Session Rehydration: The Gateway binds the evacuated player session to the least-loaded healthy node (
Node B). - Voice Server Handshake: Discord voice session credentials are transmitted to
Node B, restoring voice UDP delivery.
Actual player continuity during automated failover depends on the player's session resume state, network buffer depth, and upstream provider constraints.
Planned Rolling Maintenance
Administrators can gracefully evacuate nodes prior to performing operating system updates or restarts:
- Open the Gateway Admin Dashboard.
- Set the target node to
Drain Mode. - In Drain Mode, the Gateway:
- Stops accepting new player requests on that node.
- Allows existing tracks to finish playing or seamlessly transfers them to standby nodes.
- Once active sessions reach
0, the node is safe to reboot or upgrade. - After reboot, setting the node back to
Activeimmediately re-enters it into the load balancing pool.