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

Open
wants to merge 4 commits into
base: unstable
Choose a base branch
from

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]>
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 10 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

src/cluster_legacy.c Outdated Show resolved Hide resolved
@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
src/networking.c Outdated Show resolved Hide resolved
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants