Menu

qTest Controller - Setting up qTest Manager with Postgres Read Replica

Overview

The goal for this process is to split complex queries from the production database. You can use this setup alongside the qTest Controller- setting up qTest Insights with Postgres Read Replica  instructions. qTest Manager and qTest Insights do not necessarily need to share the same Postgres replica instance.

Important Replication Lag Notice

Contrary to qTest Insights, qTest Manager is very sensitive with replication lag, since a single user interaction in qTest Manager could end up generating a 'write query' to the master and immediately 'read query' to the replica.

Usually, a replication lag of a subsecond (up to 1 second) shouldn't be problematic, but anything greater than that would cause an unexpected effect on qTest Manager's operation and sometime end up becoming a bug for the application.

Prerequisite

  • Your qTest Manager and qTest Sessions database are on the same Postgres database server.
  • This article assumes you have the knowledge to create a postgres read-replica server.

Note: These instructions are verified on qtestctl 6.1.

 

Stop Manager

  • Linux (non-Docker)- Access the current directory "qtestctl" where you've installed your latest version of Manager.
    $ ./qtestctl stop
  • Windows
    C:\[path_to_qtestctl]>net stop qtest
  • Docker- Access the current directory "qtestctl" where you've installed your latest version of Manager.
    $ ./shutdown

Modify qtestctl/manager/build.gradle

  1. Line 210, replace: spring.profiles.active=postgres=>spring.profiles.active=postgres,readOnlyEnable
    build.gradle | Ex
    206 client.jdbc.postgres.driverClassName=org.postgresql.Driver
    207 client.jdbc.postgres.url=${postgresUrl}
    208 client.jdbc.postgres.username=${pgUser} 
    209 client.jdbc.postgres.password=${pgPwd}
    210 spring.profiles.active=postgres,readOnlyEnable

  2. Line 211, add the following properties:
    client.jdbc.postgres.readonly.password=${pgPwd}
    client.jdbc.postgres.readonly.username=${pgUser}
    client.jdbc.postgres.readonly.url=jdbc:postgresql://<REPLICATED_DB_HOST>:<REPLICATED_DB_PORT>/${pgDbname} (Don't forget to fill your replicated DB information into the placeholders)

    build.gradle | Ex   
    210 spring.profiles.active=postgres,readOnlyEnable
    211 client.jdbc.postgres.readonly.password=${pgPwd}
    212 client.jdbc.postgres.readonly.username=${pgUser}
    213 client.jdbc.postgres.readonly.url=jdbc:postgresql://localhost:5433/${pgDbname}
    214
    215 # search
    216 search.url=http://search:8080

Restart qTest Service and Verify 

  • Linux (non-Docker)
    $ systemctl start qtest
  • Windows
    C:\[path_to_qtestctl]>net start qtest
  • Docker
    $ ./startup

Access qTest Manager from the Product Navigator icon 9_box.png and verify connectivity

Powered by Zendesk