rachitmanit
rachitmanit

Reputation: 334

How to modify tidb default GLOBAL variables like "tidb_replica_read" value in TiDB

Concept: https://pingcap.com/docs/dev/follower-read/

For detailing, i have also asked the question in here: https://github.com/pingcap/tidb/issues/17650

While getting value of tidb_replica_read config param, it shows "leader" by DEFAULT. Document of pingcap (link at top) says that it can be set using session variable. How can i change globally. I am unable to find a my.cnf type file neither any appropriate section in TiDB config: https://github.com/pingcap/tidb/blob/master/config/config.toml.example

Can someone help if this is possible with existing TiDB support?

PS: i already tried

set @@global.tidb_replica_read='follower';

It threw error: ERROR 1105 (HY000): Variable 'tidb_replica_read' is a SESSION variable and can't be used with SET GLOBAL

Upvotes: 0

Views: 278

Answers (2)

Rahil
Rahil

Reputation: 139

Agree with AndreMouche, this is not supported as of now

Edit: My PR was merged recently - https://github.com/pingcap/tidb/pull/27622. You can expect this feature in next release

Upvotes: 1

AndreMouche
AndreMouche

Reputation: 57

According to the issue https://github.com/pingcap/tidb/issues/17650, I think the TiDB doesn't support this feature while the TiDB community is already working on this feature

Upvotes: 1

Related Questions