Skip to content

*: avoid notify privilege update for all users#57042

Merged
ti-chi-bot[bot] merged 37 commits into
pingcap:masterfrom
tiancaiamao:notify-update
Nov 29, 2024
Merged

*: avoid notify privilege update for all users#57042
ti-chi-bot[bot] merged 37 commits into
pingcap:masterfrom
tiancaiamao:notify-update

Conversation

@tiancaiamao

@tiancaiamao tiancaiamao commented Oct 31, 2024

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: ref #55563

Problem Summary:

In the previous commit, I have maintained the active user lists, this commit intend to fix the notify part.
When privilege change, just notify the changed users and update data for them, instead of all the users.

What changed and how does it work?

The code changes including:

  • notify privilege update will encoding the changed user list into the etcd message
  • the domain privilege loop will decode the user list and update only the active users among them
  • fix bug on the privilege handle merge operation, the old "append diff + sort + dedup" can not handle the reovke privilege operation
  • the roles of a user is also consider as the privilege data and ensureActiveUse() need to load them
  • ensureActiveUser() should load the privilege data of the user, the roles of the data, plus the data of roles recursively
  • ensureActiveUser() is called more widely now to make the CI pass (we'd better optimize here later)

Check List

Tests

  • Unit test

  • Integration test

  • Manual test (add detailed scripts or steps below)

  • No need to test

    • I checked and no code files have been changed.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

@ti-chi-bot ti-chi-bot Bot added release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 31, 2024
@tiprow

tiprow Bot commented Oct 31, 2024

Copy link
Copy Markdown

Hi @tiancaiamao. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@codecov

codecov Bot commented Oct 31, 2024

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 73.91304% with 72 lines in your changes missing coverage. Please review.

Project coverage is 74.7434%. Comparing base (05a2f4d) to head (c184096).
Report is 1 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #57042        +/-   ##
================================================
+ Coverage   72.8600%   74.7434%   +1.8834%     
================================================
  Files          1677       1722        +45     
  Lines        464466     472757      +8291     
================================================
+ Hits         338410     353355     +14945     
+ Misses       105163      97171      -7992     
- Partials      20893      22231      +1338     
Flag Coverage Δ
integration 49.2220% <71.3768%> (?)
unit 72.2524% <72.1014%> (-0.0164%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 52.7673% <ø> (ø)
parser ∅ <ø> (∅)
br 61.1876% <0.0000%> (+15.4799%) ⬆️

@ti-chi-bot ti-chi-bot Bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 4, 2024
@tiancaiamao

Copy link
Copy Markdown
Contributor Author

/retest

@tiprow

tiprow Bot commented Nov 5, 2024

Copy link
Copy Markdown

@tiancaiamao: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

Details

In response to this:

/retest

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@tiancaiamao

Copy link
Copy Markdown
Contributor Author

/test check-dev2

@tiprow

tiprow Bot commented Nov 7, 2024

Copy link
Copy Markdown

@tiancaiamao: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

Details

In response to this:

/test check-dev2

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@tiancaiamao

Copy link
Copy Markdown
Contributor Author

/test pull-br-integration-test

@tiprow

tiprow Bot commented Nov 8, 2024

Copy link
Copy Markdown

@tiancaiamao: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

Details

In response to this:

/test pull-br-integration-test

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@tiprow

tiprow Bot commented Nov 21, 2024

Copy link
Copy Markdown

@tiancaiamao: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

Details

In response to this:

/test unit-test

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@tiancaiamao tiancaiamao requested a review from D3Hunter November 22, 2024 02:50

@lcwangchao lcwangchao left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@ti-chi-bot ti-chi-bot Bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Nov 22, 2024
Co-authored-by: D3Hunter <jujj603@gmail.com>
@ti-chi-bot ti-chi-bot Bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Nov 28, 2024
@ti-chi-bot

ti-chi-bot Bot commented Nov 28, 2024

Copy link
Copy Markdown

[LGTM Timeline notifier]

Timeline:

  • 2024-11-22 03:22:10.09138556 +0000 UTC m=+174717.711040075: ☑️ agreed by lcwangchao.
  • 2024-11-28 07:58:54.091817784 +0000 UTC m=+709721.711472299: ☑️ agreed by D3Hunter.

@D3Hunter

Copy link
Copy Markdown
Contributor

/hold

still discussing some issue

@ti-chi-bot ti-chi-bot Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 28, 2024
@tiprow

tiprow Bot commented Nov 28, 2024

Copy link
Copy Markdown

@tiancaiamao: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
fast_test_tiprow f60c509 link true /test fast_test_tiprow

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@BornChanger BornChanger left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

br part lgtm

@ti-chi-bot

ti-chi-bot Bot commented Nov 28, 2024

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: BornChanger, D3Hunter, lcwangchao

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot Bot added the approved label Nov 28, 2024
@tiancaiamao

Copy link
Copy Markdown
Contributor Author

/unhold

@ti-chi-bot ti-chi-bot Bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 28, 2024
@ti-chi-bot ti-chi-bot Bot merged commit ec288d9 into pingcap:master Nov 29, 2024
@tiancaiamao tiancaiamao deleted the notify-update branch November 30, 2024 08:56
@xhebox

xhebox commented Feb 27, 2025

Copy link
Copy Markdown
Contributor

/cherry-pick release-8.5

@ti-chi-bot

Copy link
Copy Markdown
Member

@xhebox: new pull request created to branch release-8.5: #59797.

Details

In response to this:

/cherry-pick release-8.5

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved lgtm release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants