[MXS-2747] Add default database to session status output Created: 2019-10-29  Updated: 2019-12-20  Resolved: 2019-12-20

Status: Closed
Project: MariaDB MaxScale
Component/s: maxctrl
Affects Version/s: 2.3.12
Fix Version/s: 2.5.0

Type: New Feature Priority: Major
Reporter: Wagner Bianchi (Inactive) Assignee: markus makela
Resolution: Fixed Votes: 0
Labels: None


 Description   

Original title: Can the list sessions include "database" and "protocol" columns for the sake of Persistent Connections?

Folks,

Working with the MaxScale Persistent Connections, I'm missing a way to make sure all the connections the MaxScale is receiving can be used. Maybe there is another way to look at that piece of information I'm looking for, but, using the `list sessions` command with the MaxCtrl is a pretty convenient way of retrieving that.

Researching a little bit, I found on the public documentation that:

Please note that because persistent connections have previously been in use, they may give a different environment from a fresh connection. For example, if the previous use of the connection issued "use mydatabase" then this setting will be carried over into the reuse of the same connection. For many applications, this will not be noticeable since each request will assume that nothing has been set and will issue fresh requests such as "use" to establish the desired configuration. In exceptional cases, this feature could be a problem.

I'm not saying that I have that issue, but, if the `maxctrl list sessions` could include the database (if the connection does a <use db>) and the protocol (which by now will always by the mariadbbackend). This way we can look at that and tell, connections are being reused.

What do you think? Thanks!



 Comments   
Comment by markus makela [ 2019-10-29 ]

That documentation must be from 1.4 as all modern version automatically reset the connection state.

Comment by Wagner Bianchi (Inactive) [ 2019-10-29 ]

You're right about the new docs, but the database is still carried over to reused connection. The newest documentation differs from the one posted mostly to the new lazy initialization of the persistent connections. Maybe, adding those two new columns will be useful to look at it and see connections being reused in the case a database is chosen for the context of the connection.

Comment by Wagner Bianchi (Inactive) [ 2019-10-29 ]

Just sharing the right doc extract:

Please note that in versions before 2.1 the persistent connections may give a different environment when compared to a fresh connection. For example, if the previous use of the connection issued a "USE mydatabase;" statement then this setting will be carried over into the reuse of the same connection. For many applications, this will not be noticeable since each request will assume that nothing has been set and will issue fresh requests such as "USE" to establish the desired configuration. In exceptional cases, this feature could be a problem.

Comment by markus makela [ 2019-10-29 ]

displaying the current default database of the connection would certainly be possible.

Comment by Wagner Bianchi (Inactive) [ 2019-10-29 ]

Thanks, Markus!

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