Migrate to tower-grpc
brson opened this issue · 4 comments
The gRPC stack tikv is on is unloved and it looks like the future of gRPC in Rust is https://github.com/tower-rs/tower-grpc. Let's start migrating in that direction.
There will be many unknowns here, upstream contributions needed, benchmarking, careful regression testing.
This is a great idea! Hope @carllerche can help us :-)
If we really want to do this, at first, I guess we need to do a benchmark comparing the C gRPC and tower gRPC.
To add tower-rs to TiKV, we may:
- Generate the related server code with tower gRPC from our proto kvproto.
- Add a new port for TiKV (maybe 20181) for the tower gRPC so both two gRPC can run at the same time.
- Try to support some basic APIs like RawPut, RawGet.
- Try to let two TiKV communicate through tower gRPC. We can assume that if the remote TiKV port is 20160, the tower port is 20161(20160 + 1)
For 3 and 4, maybe the most problem for us is how to handle two different protobuf libraries, now we heavily depend on rust-protobuf, but tower uses prost, migrating to prost will change lots of code and take a long time.
I think at first we can migrate rust-protobuf to prost, then we can try tower-grpc easily.