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

[to #556] slowlog: attach cluster_id and pd_addresses to slow log properties #557

Merged
merged 4 commits into from
Mar 21, 2022

Conversation

iosmanthus
Copy link
Member

@iosmanthus iosmanthus commented Mar 16, 2022

Signed-off-by: iosmanthus myosmanthustree@gmail.com

What problem does this PR solve?

Issue Number: to #556

Problem Description:
Attach cluster_id and pd_addresses to slow log to distinguish the request destination while handling multiple TiKV clusters.

What is changed and how does it work?

Add withFields for SlowLogImpl, and use this interface to attach info dynamically while constructing the slow logger.

Code changes

  • Has exported function/method change

Check List for Tests

This PR has been tested by at least one of the following methods:

  • Unit test

Related changes

  • Need to cherry-pick to the release branch
  • Need to update the documentation
  • Need to be included in the release note

Signed-off-by: iosmanthus <myosmanthustree@gmail.com>
marsishandsome
marsishandsome previously approved these changes Mar 17, 2022
Copy link
Collaborator

@marsishandsome marsishandsome left a comment

Choose a reason for hiding this comment

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

LGTM

src/main/java/org/tikv/common/PDClient.java Outdated Show resolved Hide resolved
Signed-off-by: iosmanthus <myosmanthustree@gmail.com>
@iosmanthus iosmanthus changed the title [close #556] slowlog: attach cluster_id and pd_addresses to slow log properties [to #556] slowlog: attach cluster_id and pd_addresses to slow log properties Mar 17, 2022
marsishandsome
marsishandsome previously approved these changes Mar 17, 2022
zz-jason
zz-jason previously approved these changes Mar 17, 2022
Copy link
Member

@zz-jason zz-jason left a comment

Choose a reason for hiding this comment

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

LGTM

ti-srebot
ti-srebot previously approved these changes Mar 17, 2022
Signed-off-by: iosmanthus <myosmanthustree@gmail.com>
@codecov
Copy link

codecov bot commented Mar 21, 2022

Codecov Report

Merging #557 (284814c) into master (9798382) will decrease coverage by 0.18%.
The diff coverage is 94.73%.

@@             Coverage Diff              @@
##             master     #557      +/-   ##
============================================
- Coverage     32.23%   32.05%   -0.19%     
  Complexity     1332     1332              
============================================
  Files           278      279       +1     
  Lines         17345    17372      +27     
  Branches       1975     1980       +5     
============================================
- Hits           5591     5568      -23     
- Misses        11145    11194      +49     
- Partials        609      610       +1     
Impacted Files Coverage Δ
...ain/java/org/tikv/common/log/SlowLogEmptyImpl.java 57.14% <0.00%> (-9.53%) ⬇️
src/main/java/org/tikv/raw/RawKVClient.java 61.83% <92.85%> (+0.18%) ⬆️
src/main/java/org/tikv/common/PDClient.java 59.75% <100.00%> (+0.19%) ⬆️
src/main/java/org/tikv/common/log/SlowLog.java 100.00% <100.00%> (ø)
src/main/java/org/tikv/common/log/SlowLogImpl.java 98.50% <100.00%> (+0.63%) ⬆️
...rc/main/java/io/grpc/netty/NettyClientHandler.java 55.81% <0.00%> (-7.55%) ⬇️
...ty/handler/codec/http2/Http2ConnectionHandler.java 49.87% <0.00%> (-3.18%) ⬇️
...va/org/tikv/common/region/StoreHealthyChecker.java 63.15% <0.00%> (-1.32%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9798382...284814c. Read the comment docs.

Signed-off-by: iosmanthus <myosmanthustree@gmail.com>
@zz-jason zz-jason merged commit d354ffc into tikv:master Mar 21, 2022
ti-srebot pushed a commit to ti-srebot/client-java that referenced this pull request Mar 21, 2022
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Collaborator

cherry pick to release-3.1 in PR #559

ti-srebot pushed a commit to ti-srebot/client-java that referenced this pull request Mar 21, 2022
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Collaborator

cherry pick to release-3.2 in PR #560

zz-jason pushed a commit that referenced this pull request Mar 24, 2022
…perties (#557) (#559)

Co-authored-by: iosmanthus <dengliming@pingcap.com>
Co-authored-by: iosmanthus <myosmanthustree@gmail.com>
zz-jason added a commit that referenced this pull request Mar 28, 2022
…perties (#557) (#560)

Co-authored-by: iosmanthus <dengliming@pingcap.com>
Co-authored-by: Jian Zhang <zjsariel@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants