[MDEV-15450] Add Host Name Field to MariaDB Client Handshake Protocol Created: 2018-03-02 Updated: 2018-05-22 Resolved: 2018-05-22 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Server |
| Fix Version/s: | 10.3.7 |
| Type: | Task | Priority: | Blocker |
| Reporter: | Alex Lee | Assignee: | Vladislav Vaintroub |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | client, contribution, foundation, protocol | ||
| Attachments: |
|
||||||||||||||||
| Issue Links: |
|
||||||||||||||||
| Description |
WhyIn original, one MariaDB server instance is identified by one address (IP + port). That is not enough for a shared proxy for multi servers. Like HTTP HOST header, which enables virtual host in a web server machine [1]. The similar approach is used in Oracle net listener by adding INSTANCE_NAME [2]. Adding the host name field helps the proxy layer to find the backend server, monitor full throughput easily, and can do the specific logic on different host. For cloud service, let server instance can be identified by <server name, address (IP + port)> will help to simplified workflow for the frontend proxy. What to doSince 10.0.5. MariaDB started supporting applications to pass key/value connection attributes when connecting [3]. MariaDB reserves the attribute names that begin with an underscore (_) for internal use which should not be created by application programs [4]. The proposal is using the same approach to reserve one more name. The attribute is named ‘_host_name’ to record the host name used in the connection string (the connection parameters). This field is used by the server or proxy to figure out which server the client is trying to connect to. The client drivers that support this protocol sends the attribute in the handshake response packet. The code change involves: [1]. https://stackoverflow.com/questions/43156023/what-is-http-host-header |
| Comments |
| Comment by Otto Kekäläinen [ 2018-04-26 ] |
|
Thanks for the detailed feature specification. Do you have any patches / prototype code or something related to this? |
| Comment by xiangyhu [ 2018-05-09 ] |
|
Hi otto, thanks for you comment, I have attached the screenshot which includes the _host_name attribute proposed, please check out. Thanks, |
| Comment by Otto Kekäläinen [ 2018-05-09 ] |
|
Nice. So you already have a patch against MySQL 5.7? Can you rebase it on MariaDB 10.3/10.4 and share? |
| Comment by xiangyhu [ 2018-05-10 ] |
|
otto Yeah sure, I have created pull request at https://github.com/MariaDB/server/pull/751, please help to review! Thanks, |
| Comment by Vladislav Vaintroub [ 2018-05-10 ] |
|
actually our server supports proxy protocol, and MaxScale uses it too. Would not this do the same thing that proxy protocol does? |
| Comment by Sergei Golubchik [ 2018-05-11 ] |
|
No, that's different, as far as I understand. In the proxy protocol you specify what host you connect from, but here you specify what host you connect to. |
| Comment by Vladislav Vaintroub [ 2018-05-11 ] |
|
right,I figured this too, from looking at the patch. The "host_name" was a little confusing, but now it changed to _server_host , and this is more clear. |
| Comment by Sergei Golubchik [ 2018-05-11 ] |
|
Reopening until C/C is fixed too |