Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
-
None
Description
Currently, SmartRouter returns the first received response, irrespective of which target returns it. If all targets are known to be identical, that is acceptable because, in that case, if one server returns an error any other server will return as well, and in principle the system will unnecessarily stall, while waiting for the master target to respond. However, that is likely to be rather theoretical as, if the there is an error, the master target will respond quickly as well.
However, if the servers are not identical, this approach leads to problems. For instance, if a particular table is found on the master, but not on other servers, the response the client will receive - a resultset or error - depends on which server responds first. Same result if the servers do not support the same SQL (e.g. MariaDB and Exasol).
That kind of non-deterministic behavior is unacceptable. Consequently, SmartRouter should only return resultsets from a non-master target. If a non-master target returns something else, the SmartRouter should wait for the response from the master target and return that.
Was: Allow SmartRouter behaviour to be tuned (task)
When SmartRouter is used only with MariaDB databases, it can return the first response to the client, irrespective of which specific server returns it. However, when the targets of SmartRouter are heterogenous servers, that leads to undesirable behaviour.
For instance, this is what happens when one target is MariaDB and the other is Exasol.
MariaDB [(none)]> select sleep(5);
|
ERROR 3968 (42000): [Exasol][Exasol Driver]function or script SLEEP not found [line 1, column 8] (Session: 1849199817772630016)
|
Since Exasol does not have sleep(), it will respond first with an error, which will also be returned to the client.
For heterogenous cases, it should be possible to configure SmartRouter to behave like:
- return non-error results from non-master if faster, else return results from master.
Attachments
Issue Links
- blocks
-
MXS-5888 Create an ExasolRouter
-
- In Progress
-