Skip to content
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

Add short client info log to CLUSTER MEET / FORGET / RESET commands #1249

Merged
merged 4 commits into from
Nov 22, 2024

Conversation

enjoy-binbin
Copy link
Member

@enjoy-binbin enjoy-binbin commented Nov 2, 2024

These commands are all administrator commands. If they are operated
incorrectly, serious consequences may occur. Print the full client
info by using catClientInfoString, the info is useful when we want
to identify the source of request.

Since the origin client info is very large and might complicate the
output, we added a catClientInfoShortString function, it will only
print some basic fields, we want these fields that are useful to
identify the client. These fields are:

  • id
  • addr
  • laddr
  • connection info
  • name
  • user
  • lib-name
  • lib-ver

And also used it to replace the origin client info where it has the
same purpose. Some logging is changed from full client info to short
client info:

  • CLUSTER FAILOVER
  • FAILOVER / PSYNC
  • REPLICAOF NO ONE
  • SHUTDOWN

These commands are all administrator commands. If they are operated
incorrectly, serious consequences may occur. Print the full client
info by using catClientInfoString, the info is useful when we want
to identify the source of request.

Signed-off-by: Binbin <[email protected]>
@enjoy-binbin enjoy-binbin requested a review from PingXie November 2, 2024 16:16
Copy link

codecov bot commented Nov 3, 2024

Codecov Report

Attention: Patch coverage is 92.85714% with 1 line in your changes missing coverage. Please review.

Project coverage is 70.69%. Comparing base (45d596e) to head (52c7ebc).
Report is 37 commits behind head on unstable.

Files with missing lines Patch % Lines
src/cluster_legacy.c 75.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #1249      +/-   ##
============================================
+ Coverage     70.56%   70.69%   +0.13%     
============================================
  Files           114      115       +1     
  Lines         63147    63168      +21     
============================================
+ Hits          44560    44657      +97     
+ Misses        18587    18511      -76     
Files with missing lines Coverage Δ
src/networking.c 88.68% <100.00%> (+0.06%) ⬆️
src/replication.c 87.23% <100.00%> (-0.05%) ⬇️
src/server.c 87.62% <100.00%> (-0.07%) ⬇️
src/server.h 100.00% <ø> (ø)
src/cluster_legacy.c 86.35% <75.00%> (+<0.01%) ⬆️

... and 23 files with indirect coverage changes

---- 🚨 Try these New Features:

@enjoy-binbin enjoy-binbin changed the title Add client info log to CLUSTER MEET / FORGET / RESET Add short client info log to CLUSTER MEET / FORGET / RESET commands Nov 9, 2024
Signed-off-by: Binbin <[email protected]>
Copy link
Member

@ranshid ranshid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - Thank you!

Copy link
Contributor

@zuiderkwast zuiderkwast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR message should also mention that some logging is changed from full client info to short client info.

@enjoy-binbin enjoy-binbin merged commit 9851006 into valkey-io:unstable Nov 22, 2024
48 checks passed
@enjoy-binbin enjoy-binbin added the release-notes This issue should get a line item in the release notes label Nov 22, 2024
@enjoy-binbin enjoy-binbin deleted the log branch November 22, 2024 16:23
vudiep411 pushed a commit to vudiep411/valkey that referenced this pull request Nov 26, 2024
…alkey-io#1249)

These commands are all administrator commands. If they are operated
incorrectly, serious consequences may occur. Print the full client
info by using catClientInfoString, the info is useful when we want
to identify the source of request.

Since the origin client info is very large and might complicate the
output, we added a catClientInfoShortString function, it will only
print some basic fields, we want these fields that are useful to
identify the client. These fields are:
- id
- addr
- laddr
- connection info
- name
- user
- lib-name
- lib-ver

And also used it to replace the origin client info where it has the
same purpose. Some logging is changed from full client info to short
client info:
- CLUSTER FAILOVER
- FAILOVER / PSYNC
- REPLICAOF NO ONE
- SHUTDOWN

Signed-off-by: Binbin <[email protected]>
Signed-off-by: vudiep411 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-notes This issue should get a line item in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants