Why DistroProtocol does not implement APProtocol interface, and what is the intended usage of APProtocol? #14999
AngusYGChen
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Nacos maintainers and community,
I've been deeply studying the consistency protocol architecture of Nacos recently, and I found a very interesting and confusing design that I couldn't find a clear explanation for in the official documentation or existing issues.
What I observed
JRaftProtocolproperly implements theCPProtocolinterface, and it is correctly initialized and managed byProtocolManager.APProtocolinterface extendsConsistencyProtocolbut does not add any methods, and there is no class in the entire codebase that implements this interface.DistroProtocoldoes not implement any consistency protocol interface at all. It is a completely independent@Componentclass.initAPProtocol()method inProtocolManagertries to get anAPProtocolbean from the Spring context, but this code path is never executed because there is no such bean.DistroProtocoland calls its native methods likesync().My questions
APProtocolinterface? What is its intended usage if it has no implementations?DistroProtocolbeen refactored to implementAPProtocol? Are there fundamental incompatibilities between the Distro protocol design and the genericConsistencyProtocolinterface?APProtocolinterface?This design has confused many developers who are learning Nacos's internal architecture. A clear explanation from the official team would be extremely helpful for the community to understand Nacos's design philosophy and evolution history.
Thank you very much for your time and explanation!
Beta Was this translation helpful? Give feedback.
All reactions