As we work toward stabilization of the experimental resolver/balancer plugin APIs, the gRPC team will be making several non-backward compatible changes to enable new functionality and better extensibility for the future. These changes are not strictly following semantic versioning or the Go compatibility promise, but they are in accordance with our versioning policy as the changes are limited to experimental APIs.
Items will be checked off of the following list as they are completed.
resolver.BuildOption to BuildOptions (#3175)resolver.ResolveNowOption to ResolveNowOptions (#3175)balancer.PickOptions to PickInfo (#3186)For the short-term, to allow an easier migration, type aliases will be put in place for the old symbols.
balancer PackageV2Picker (eventually replacing Picker), featuring changed semantics to allow for new capabilities, and for future-proofing. (#3186)ClientConn.UpdateState (eventually replacing UpdateBalancerState). This is future-proofing to allow addition of new items in the balancer's state, and contains a V2Picker instead of Picker. (#3186)balancer.Balancer and balancer.Picker with the V2Balancer and V2Picker versions. To allow an easier migration for users currently referencing the V2 names, create type aliases. (Typically, referencing these interface types should not be necessary.) (#3431)balancer.ClientConn.UpdateBalancerState. (#3431)grpc.Balancer, and all related functionality. (#3431)naming package. (#3431)V2Balancer and V2Picker type aliases, and base package "V2" references. (#3742)The resolver and balancer APIs will be kept in the experimental state after these changes, as there may be more breaking changes needed in the near future.
Hi @dfawley, even though these changes were to "experimental" APIs, multiple external projects do depend on them, at different versions of this library. This is a significant problem for the Go ecosystem because any project trying to import recent versions of (for example) both cloud.google.com/go and go.etcd.io/etcd are unable to build, since they both depend different versions within major version 1 of this module, one before and one after these breaking changes. This means downstream projects are stuck on much older versions of those libraries as well as grpc-go itself. Would you consider changing the versioning policy to observe the Go compatibility promise?
In the meantime, would you consider adding type aliases so that code which relies on both the old and new names of these types can still compile?
@samsalisbury ,
Would you consider changing the versioning policy to observe the Go compatibility promise?
It was a mistake for any other projects to use these packages without transitively marking themselves as experimental. Unfortunately the Go compatibility promise doesn't have any convention that allows us to experiment with APIs to see what will work well for our users or to release functionality before it's fully supported for advanced users that can tolerate instability. We've discussed using separate modules (at v0) for this purpose, but it oftentimes isn't technically possible to achieve the separation needed for this.
In the meantime, would you consider adding type aliases so that code which relies on both the old and new names of these types can still compile?
We had type aliases in place for the 1.26 release, and marked them as deprecated, in order to allow projects a chance to do a smooth migration. Unfortunately, we cannot leave type aliases in place forever; projects will need to upgrade.
Sorry for any disturbances this has caused.
Hi, thanks for the response @dfawley, most conversation happening in https://github.com/grpc/grpc-go/pull/3500 now I think. I think it seems like a reasonable desire (to want to add things that should not be depended on yet) but unfortunately I don't think relying on the eternal vigilance of multiple parties to always respect this rule is likely to work in the long term, especially as it is special to this repository or organisation. The good thing about go's compatibility rules are that they are at least a single standard that everyone could probably bend to if they wanted, for the sake of the ecosystem. Rather than relying on eternal vigilance, they have built tools that break builds when these rules are not followed, which at least is some kind of feedback projects will hit eventually.
Most helpful comment
Hi @dfawley, even though these changes were to "experimental" APIs, multiple external projects do depend on them, at different versions of this library. This is a significant problem for the Go ecosystem because any project trying to import recent versions of (for example) both
cloud.google.com/goandgo.etcd.io/etcdare unable to build, since they both depend different versions within major version 1 of this module, one before and one after these breaking changes. This means downstream projects are stuck on much older versions of those libraries as well asgrpc-goitself. Would you consider changing the versioning policy to observe the Go compatibility promise?In the meantime, would you consider adding type aliases so that code which relies on both the old and new names of these types can still compile?