tipocket icon indicating copy to clipboard operation
tipocket copied to clipboard

Two unused config design

Open xhebox opened this issue 4 years ago • 0 comments

ClientCount config

ClientCount does not determine the real number of instances, but ClientNodes do. This Count only prevents one from running multiple client.Start, link.

I would suggest removing this option and the design of multi clients:

  1. no cases specify a count other than 1.
[xhe@PC geo-partition]$ rg 'ClientCount: 1' ..
../example/cmd/main.go
36:             ClientCount: 1,
...
../pocket/cmd/dm-pocket/main.go
40:             ClientCount: 1,
[xhe@PC geo-partition]$ rg 'ClientCount: 2' ..
[xhe@PC geo-partition]$ rg 'ClientCount: 3' ..
  1. If I want two or more clients for tests, I am likely to want to "share" something between these clients. In that case, I mostly need more precise control over these two clients. Then, in fact, tipocket becomes a barrier: it may not control clients in your way.
  2. Two completely independent clients can not go wrong even in parallel. If they do go wrong, then they are not independent. This is can be archived by creating multiple clients, running for sometime to do a completely black box test. If ClientCount can do something, then this is the only case. Yet it can be archived by running two clients by myself.

It would be more appropriate to provide some concurrent helpers in util package than in the core.

DB config

Another config that is not used at all. And it is invoked for every node, even if it is not a TiDB node, there is always logs about it:

o:349: [info] begin to set up database on node[comp=drainer,ip=:8249,ns=tipocket,pod=geo-partition-drainer-0]
2021/02/24 13:44:26 control.go:349: [info] begin to set up database on node[comp=pd,ip=geo-partition-upstream-pd-0.geo-partition-upstream-pd-peer.tipocket.svc:2379,ns=tipocket,pod=geo-partition-upstream-pd-0]
2021/02/24 13:44:26 control.go:349: [info] begin to set up database on node[comp=tikv,ip=geo-partition-upstream-tikv-2.geo-partition-upstream-tikv-peer.tipocket.svc:20160,ns=tipocket,pod=geo-partition-upstream-tikv-2]
...
2021/02/24 13:44:26 control.go:349: [info] begin to set up database on node[comp=pd,ip=geo-partition-downstream-pd-0.geo-partition-downstream-pd-peer.tipocket.svc:2379,ns=tipocket,pod=geo-partition-downstream-pd-0]
2021/02/24 13:44:26 control.go:349: [info] begin to set up database on node[comp=tikv,ip=geo-partition-upstream-tikv-0.geo-partition-upstream-tikv-peer.tipocket.svc:20160,ns=tipocket,pod=geo-partition-upstream-tikv-0]

go-sqlsimith is using their own db management system, link. Same to ClientCount, we can extract a helper, and I don't think it fits well into cases other than one TiDB cluster + simple sql tests.

xhebox avatar Feb 24 '21 06:02 xhebox