Please read https://github.com/etcd-io/etcd/blob/master/Documentation/reporting-bugs.md.
Hi,
I am currently trying to understand the code implementation for etcd. I am trying to understand different workflows and their respective code entry-points (files / functions / interface & struct declarations etc.).
Eg: Say I want to understand the workflow in the code that gets triggered, when doing some key specific operation (get, put, etc.). Right now, I am kind-of lost and not sure where to start tracing the execution workflow. I am new to etcd and would really appreciate if someone could point out the key areas / entry-points in the code or any articles about the internals of etcd.
So to re-iterate, I want to understand the codebase better and probably pointers to important files or functions / routines would be helpful in understanding different workflows.
What I have already found (not sure if correct though):
/etcd/vendor/.../soheilhy/cmux/cmux.go -> Serve (This holds the loop that listens to client connections).
But I couldn't figure out how to trace an operation from there, such as a get. What is called next? Which file is that operation handler present in, etc.
I am using delve to setup breakpoints and step through / over the executing goroutines.
Thanks in advance!
@dipAch Maybe this is the flow to look at:
embed/etcd.go - StartEtcd() function calls functions such as: serveClients(), servePeers(), serveMetrics(). serveClients() depending on whether its V2 or not, calls the handler function
You might want to look at v2http/client.go and embed/serve.go
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 21 days if no further activity occurs. Thank you for your contributions.
Most helpful comment
@dipAch Maybe this is the flow to look at:
embed/etcd.go - StartEtcd() function calls functions such as: serveClients(), servePeers(), serveMetrics(). serveClients() depending on whether its V2 or not, calls the handler function
You might want to look at v2http/client.go and embed/serve.go