Closed newhook closed 1 year ago
You don't need to take down everything at the same time. Once all the clients are updated to use the header dial, you can then change the server listenmux default listener to also serve DRPC because no clients are expecting gRPC anymore. Then, once all the servers are updated, you can change all the clients to no longer send he header. Then you can remove the listenmux entirely if you want. Basically the same steps in reverse.
Thanks I’ll try that.
Ok, I tested the migration process, and yes, it works just as you say.
Basically you run the drpc server on the routing listener mux and the default mux.
return s.Serve(ctx, lisMux.Route(drpcmigrate.DRPCHeader))
^^ this looks for the drpcheader and forwards all requests to drpc.
return s.Serve(ctx, lisMux.Default())
^^ this forwards unconditionally all requests to drpc, and was originally attached to grpc.
The migration steps in the blog post are:
I was just experimenting with that, and all that works well. Except I realized that to use the migration the drpc dialing needs to be switched to send the header.
It seems like after grpc is gone ideally you'd also want to switch this back to a plain headerless dial, but won't doing that require taking down all servers and clients at the same time, as the headerless dial is incompatible with the listen multiplexer?