mirror of
https://github.com/grafana/grafana.git
synced 2024-11-29 04:04:00 -06:00
50244ed4a1
This adds a version of the SQLStore that includes a ReadReplica. The primary DB can be accessed directly - from the caller's standpoint, there is no difference between the SQLStore and ReplStore unless they wish to explicitly call the ReadReplica() and use that for the DB sessions. Currently only the stats service GetSystemStats and GetAdminStats are using the ReadReplica(); if it's misconfigured or if the databaseReadReplica feature flag is not turned on, it will fall back to the usual (SQLStore) behavior. Testing requires a database and read replica - the replication should already be configured. I have been testing this locally with a docker mysql setup (https://medium.com/@vbabak/docker-mysql-master-slave-replication-setup-2ff553fceef2) and the following config: [feature_toggles] databaseReadReplica = true [database] type = mysql name = grafana user = grafana password = password host = 127.0.0.1:3306 [database_replica] type = mysql name = grafana user = grafana password = password host = 127.0.0.1:3307 |
||
---|---|---|
.. | ||
doc.go | ||
instrumentation_service_test.go | ||
instrumentation_service.go | ||
module_runner.go | ||
module_server_test.go | ||
module_server.go | ||
runner.go | ||
server_test.go | ||
server.go | ||
service.go | ||
test_env.go | ||
wire.go | ||
wireexts_oss.go |