[MXS-3476] Enable session redistribution and rebalancing for applications relying on session pooling Created: 2021-03-31  Updated: 2022-04-22  Resolved: 2021-04-07

Status: Closed
Project: MariaDB MaxScale
Component/s: Documentation
Affects Version/s: None
Fix Version/s: N/A

Type: New Feature Priority: Major
Reporter: Gregory Dorman (Inactive) Assignee: Todd Stoffel (Inactive)
Resolution: Won't Do Votes: 0
Labels: Xpand

Issue Links:
PartOf
includes MXS-2347 New servers are not taken into use mi... Closed

 Description   

The general description and the full background can be found in

https://docs.google.com/document/d/14TsnuBUZ_WCcwv3jJqBnF3TuBiU_OHBTzTP7Zx_Xxjc/edit#heading=h.gnlldgczly15

It appears the proposal can be implemented in 2 phases.

Phase 1 . This is likely to be satisfactory to the client in question. At this stage we will still rely on command history for both RETRY and session failover. What this ticket is requesting is:

a) Enable an additional directive to MaxScale requesting "rebalancing" of existing sessions. This operation would be requested when the XPAND cluster is enlarged.
The act of rebalancing can be of longer duration. Sessions which are currently "eligible" (have no outstanding transactions opened on them) can be "moved" right away.
If the desired distribution is not immediately achieved, additional "moves" can be delayed and performed when presently active transactions complete.

b)Enable additional directive to redistribute sessions presently located on a living server to other servers. This should be requested prior to terminating a node gracefully.
We will probably owe them a method of checking if such redistribution has been completed.

In Phase 2, if we ever go there, we can talk about enhancing the current mechanism of moving sessions which presently depends on command history.

Instead, "eligible" sessions get "moved" to a different server by
--Reading its current Session State (below), and
--Reconstructing that state on a target server

Some proposed alternatives and possible risks are outlined in the referenced paper.



 Comments   
Comment by markus makela [ 2021-04-01 ]

The first part seems like a duplicated of MXS-2347: Depending on the module used, there's no need to move anything anywhere as either the module doesn't support reconnection at all (readconnroute) or it already dynamically manages connections and creates new ones as requested (readwritesplit, schemarouter). The only thing that needs to be done is to add new servers from the service into the active session but this might not be as simple as it seems.

The second part is essentially already implemented with the Drain server state in MaxScale which prevents new connections from being created to servers in this state. The only addition that needs to be done is to actively discard the connections to the server being drained whenever it is safe to do.

Comment by markus makela [ 2022-04-22 ]

With the addition of restart session commands for MXS-2347, this seems to now be doable in version 22.08 by doing a maxctrl restart sessions when the cluster has increased in size and a client-side connection pool is in use.

Generated at Thu Feb 08 04:21:42 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.