看了一下午,没看明白MPP下,tidb的rpc和tiflash通信的代码在哪里?
从入口 DispatchMPPTasks 进来,一路看下来,直到 HandleMPPDAGReq
func HandleMPPDAGReq(dbReader *dbreader.DBReader, req *coprocessor.Request, mppCtx *MPPCtx) *coprocessor.Response {
dagReq := new(tipb.DAGRequest)
err := proto.Unmarshal(req.Data, dagReq)
if err != nil {
return &coprocessor.Response{OtherError: err.Error()}
}
dagCtx := &dagContext{
dbReader: dbReader,
startTS: req.StartTs,
keyRanges: req.Ranges,
}
builder := mppExecBuilder{
dbReader: dbReader,
mppCtx: mppCtx,
sc: flagsToStatementContext(dagReq.Flags),
dagReq: dagReq,
dagCtx: dagCtx,
}
mppExec, err := builder.buildMPPExecutor(dagReq.RootExecutor)
if err != nil {
panic("build error: " + err.Error())
}
err = mppExec.open()
if err != nil {
panic("open phase find error: " + err.Error())
}
_, err = mppExec.next()
if err != nil {
panic("running phase find error: " + err.Error())
}
return &coprocessor.Response{}
}
似乎在这里就是实现的最底层了。完全没有想象中的调用grpc的接口的地方