-
Notifications
You must be signed in to change notification settings - Fork 955
Cluster: Enhance debugging in logs #2815
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## unstable #2815 +/- ##
============================================
- Coverage 72.43% 72.42% -0.02%
============================================
Files 128 128
Lines 70428 70439 +11
============================================
- Hits 51017 51016 -1
- Misses 19411 19423 +12
🚀 New features to boost your workflow:
|
Signed-off-by: Zhijun <dszhijun@gmail.com>
Signed-off-by: Zhijun <dszhijun@gmail.com>
Signed-off-by: Zhijun <dszhijun@gmail.com>
…heck Signed-off-by: Zhijun <dszhijun@gmail.com>
Signed-off-by: Zhijun <dszhijun@gmail.com>
496bf37 to
018365b
Compare
JimB123
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about the .gitignore file, but otherwise looks ok.
hpatro
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[3] Add a debug log when processing a packet to show the packet type, sender node name, and sender client port (this also has the benefit of telling us whether this is an inbound or outbound link).
Not really sure about the benefit of ip/port addition to the nodename / (human nodename seems valuable) and wouldn't it be always the inbound link from another node as this is under clusterProcessPacket.
Signed-off-by: Zhijun <dszhijun@gmail.com>
Node A could fire up multiple connections to the other node B. For example, when I was investigating a tricky scenario in #2811, I needed to look at which connection node A was using to send packets to node B and why that connection was created/closed, which helped me figure out the ordering of packets. A single TCP/TLS connection can guarantee the delivery ordering of packets, but with multiple connections it's not clear which packets would be received first, and I needed to know that.
No, it can be either inbound or outbound.
If you turn on verbose/debug logging level and look at the logs carefully you will clearly see this pattern. |
|
@hpatro Could you approve if this looks good to you? |
Signed-off-by: Zhijun <dszhijun@gmail.com>
|
Looks like the known flakiness still exists |
…cessing (valkey-io#2815) Enhance debugging for cluster logs [1] Add human node names in cluster tests so that we can easily understand which nodes we are interacting with: ``` pong packet received from: 92a960ffd62f1bd04efeb260b30fe9ca6b9294ed (R4) from client: :0 node 92a960ffd62f1bd04efeb260b30fe9ca6b9294ed (R4) announces that it is a primary in shard c6d1152caee49a5e70cb4b77d1549386078be603 Reconfiguring node 92a960ffd62f1bd04efeb260b30fe9ca6b9294ed (R4) as primary for shard c6d1152caee49a5e70cb4b77d1549386078be603 Configuration change detected. Reconfiguring myself as a replica of node 92a960ffd62f1bd04efeb260b30fe9ca6b9294ed (R4) in shard c6d1152caee49a5e70cb4b77d1549386078be603 ``` [2] Currently there are logs showing the address of incoming connections: ``` Accepting cluster node connection from 127.0.0.1:59956 Accepting cluster node connection from 127.0.0.1:59957 Accepting cluster node connection from 127.0.0.1:59958 Accepting cluster node connection from 127.0.0.1:59959 ``` but we have no idea which nodes these connections refer to. I added a logging statement when the node is set to the inbound link connection. ``` Bound cluster node 92a960ffd62f1bd04efeb260b30fe9ca6b9294ed (R4) to connection of client 127.0.0.1:59956 ``` [3] Add a debug log when processing a packet to show the packet type, sender node name, and sender client port (this also has the benefit of telling us whether this is an inbound or outbound link). ``` pong packet received from: 92a960ffd62f1bd04efeb260b30fe9ca6b9294ed (R4) from client: :0 ping packet received from: 92a960ffd62f1bd04efeb260b30fe9ca6b9294ed (R4) from client: 127.0.0.1:59973 fail packet received from: 92a960ffd62f1bd04efeb260b30fe9ca6b9294ed (R4) from client: 127.0.0.1:59973 auth-req packet received from: 92a960ffd62f1bd04efeb260b30fe9ca6b9294ed (R4) from client: 127.0.0.1:59973 ``` --------- Signed-off-by: Zhijun <dszhijun@gmail.com>
…cessing (valkey-io#2815) Enhance debugging for cluster logs [1] Add human node names in cluster tests so that we can easily understand which nodes we are interacting with: ``` pong packet received from: 92a960ffd62f1bd04efeb260b30fe9ca6b9294ed (R4) from client: :0 node 92a960ffd62f1bd04efeb260b30fe9ca6b9294ed (R4) announces that it is a primary in shard c6d1152caee49a5e70cb4b77d1549386078be603 Reconfiguring node 92a960ffd62f1bd04efeb260b30fe9ca6b9294ed (R4) as primary for shard c6d1152caee49a5e70cb4b77d1549386078be603 Configuration change detected. Reconfiguring myself as a replica of node 92a960ffd62f1bd04efeb260b30fe9ca6b9294ed (R4) in shard c6d1152caee49a5e70cb4b77d1549386078be603 ``` [2] Currently there are logs showing the address of incoming connections: ``` Accepting cluster node connection from 127.0.0.1:59956 Accepting cluster node connection from 127.0.0.1:59957 Accepting cluster node connection from 127.0.0.1:59958 Accepting cluster node connection from 127.0.0.1:59959 ``` but we have no idea which nodes these connections refer to. I added a logging statement when the node is set to the inbound link connection. ``` Bound cluster node 92a960ffd62f1bd04efeb260b30fe9ca6b9294ed (R4) to connection of client 127.0.0.1:59956 ``` [3] Add a debug log when processing a packet to show the packet type, sender node name, and sender client port (this also has the benefit of telling us whether this is an inbound or outbound link). ``` pong packet received from: 92a960ffd62f1bd04efeb260b30fe9ca6b9294ed (R4) from client: :0 ping packet received from: 92a960ffd62f1bd04efeb260b30fe9ca6b9294ed (R4) from client: 127.0.0.1:59973 fail packet received from: 92a960ffd62f1bd04efeb260b30fe9ca6b9294ed (R4) from client: 127.0.0.1:59973 auth-req packet received from: 92a960ffd62f1bd04efeb260b30fe9ca6b9294ed (R4) from client: 127.0.0.1:59973 ``` --------- Signed-off-by: Zhijun <dszhijun@gmail.com>
…cessing (valkey-io#2815) Enhance debugging for cluster logs [1] Add human node names in cluster tests so that we can easily understand which nodes we are interacting with: ``` pong packet received from: 92a960ffd62f1bd04efeb260b30fe9ca6b9294ed (R4) from client: :0 node 92a960ffd62f1bd04efeb260b30fe9ca6b9294ed (R4) announces that it is a primary in shard c6d1152caee49a5e70cb4b77d1549386078be603 Reconfiguring node 92a960ffd62f1bd04efeb260b30fe9ca6b9294ed (R4) as primary for shard c6d1152caee49a5e70cb4b77d1549386078be603 Configuration change detected. Reconfiguring myself as a replica of node 92a960ffd62f1bd04efeb260b30fe9ca6b9294ed (R4) in shard c6d1152caee49a5e70cb4b77d1549386078be603 ``` [2] Currently there are logs showing the address of incoming connections: ``` Accepting cluster node connection from 127.0.0.1:59956 Accepting cluster node connection from 127.0.0.1:59957 Accepting cluster node connection from 127.0.0.1:59958 Accepting cluster node connection from 127.0.0.1:59959 ``` but we have no idea which nodes these connections refer to. I added a logging statement when the node is set to the inbound link connection. ``` Bound cluster node 92a960ffd62f1bd04efeb260b30fe9ca6b9294ed (R4) to connection of client 127.0.0.1:59956 ``` [3] Add a debug log when processing a packet to show the packet type, sender node name, and sender client port (this also has the benefit of telling us whether this is an inbound or outbound link). ``` pong packet received from: 92a960ffd62f1bd04efeb260b30fe9ca6b9294ed (R4) from client: :0 ping packet received from: 92a960ffd62f1bd04efeb260b30fe9ca6b9294ed (R4) from client: 127.0.0.1:59973 fail packet received from: 92a960ffd62f1bd04efeb260b30fe9ca6b9294ed (R4) from client: 127.0.0.1:59973 auth-req packet received from: 92a960ffd62f1bd04efeb260b30fe9ca6b9294ed (R4) from client: 127.0.0.1:59973 ``` --------- Signed-off-by: Zhijun <dszhijun@gmail.com>
Make a couple of small changes to enhance debugging.
[1] Add human node names in cluster tests so that we can easily understand which nodes we are interacting with:
[2] Currently there are logs showing the address of incoming connections:
but we have no idea which nodes these connections refer to. I added a logging statement when the node is set to the inbound link connection.
[3] Add a debug log when processing a packet to show the packet type, sender node name, and sender client port (this also has the benefit of telling us whether this is an inbound or outbound link).