Debugging read/write

This page describes reasons, why Heimdall might not use reader servers, when load balancing is enabled.

Show queryinfo

When using a tool that performs simple queries (i.e. not a prepared statement query) such as psql, after a query is executed, the command show queryinfo can be executed, which will provide information about the last query, and how it was processed, specifically the properties that were attributed to that command. An example output:

dbConsole => show queryinfo;

      Attribute       |        Value
forward:source        | MySQLDataSource
cache:ttl             | 300000
all:stop              | false
all:querytimeout      | 0
all:printtiming       | false
all:printtables       | false
all:printresults      | false
all:printmeta         | false
all:printmatch        | false
all:printcapture      | false
all:onlytrans         | false
all:olderthan         | 0
all:notrack           | false
all:maxburst          | 10
all:logger            | hdlog
all:log               | false
all:invalidate        | true
all:capture           | true
noreader              | forward:readonly is set to false, can't use reader
nocache reason        | cache is not enabled
connid                | 5
cache                 | true
autogenKeys           | true
Tables                | []
Source                | MySQLDataSource-Primary
Schema                | empty
RespTime              | 1779
DML                   | true
Catalog               | myDb
CacheHit              | miss
Autocommit            | true


noreader can have a few causes, they are explained in more detail in list below:

  • forward:readonly is set to false, can't use reader: When property forward:readonly is set to false, it means that currently Heimdall is connected to writable server.
  • No servers available, cannot forward query to reader.: There aren't any servers available in Data Source at that moment in time, therefore reader server is not being used.
  • Couldn't get Data Source while forwarding query, reader can't be used.: Error occurred while retrieving Data Source to forward query. It's good reason to verify existence of chosen Data Source.
  • Connection is set to null, reader can't be used.: Connection to Data Source couldn't be established.
  • Reader can't be used, exception on setting catalog on forwarded connection.: Exception on setting catalog on forwarded connection, check catalog/schema on current/parent connection.
  • Statement is null, query cannot be forwarded.: Forward statement couldn't be created, therefore reader cannot be used.
  • Exception on existing connection, reader can't be used.: Exception on existing connection, forwarding interrupted, reader is not in use.
  • Connection is set to null, reader can't be used.: Exception on closing connection existing connection.
  • Statement is DML/DDL type, reader can't be used.: Statement provided to the reader is DML/DDL, then it cannot be used on the readonly database.
  • Couldn't connect to source, cannot forward query, check data source in vdb configuration.: Heimdall couldn't establish connection to chosen Data Source, therefore query cannot be forwarded and reader is not in use. Please validate vdb configuration.
  • Couldn't connect to source, cannot forward query.: Exception on connecting to source, query cannot be forwarded thus reader used.
  • Server isn't reader eligible, reader can't be used.: Current server isn't reader eligible, so Heimdall won't even try using reader.