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

privilege, domain: reduce the memory jitter of privilege reload activity for 2M users #59487

Merged
merged 36 commits into from
Feb 27, 2025
Merged
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
6d2d115
*: add sql variable @@tidb_accelerate_user_creation_update
tiancaiamao Dec 24, 2024
fa3b31d
make lint happy
tiancaiamao Dec 24, 2024
899b9b0
make bazel_prepare
tiancaiamao Dec 24, 2024
b6a27f5
make lint happy
tiancaiamao Dec 25, 2024
44ead1b
make lint happy
tiancaiamao Dec 25, 2024
8575707
privilege: change privilege user data representation
tiancaiamao Jan 2, 2025
cb0536d
fix build
tiancaiamao Jan 2, 2025
fa5155d
save changes
tiancaiamao Jan 6, 2025
42aee08
Merge branch 'master' into full-priv
tiancaiamao Jan 10, 2025
f0e2734
Merge branch 'master' into full-priv
tiancaiamao Jan 15, 2025
a593920
clean up
tiancaiamao Jan 15, 2025
755e856
cleanup
tiancaiamao Jan 15, 2025
8834bb3
fix CI
tiancaiamao Jan 16, 2025
5b48498
fix issues/59018
tiancaiamao Jan 20, 2025
39c1a98
Merge branch 'pr/58512' into test
tiancaiamao Jan 20, 2025
78161e6
fix panic and add log
tiancaiamao Jan 20, 2025
8aa40f7
add log and avoid loadSomeUser for 1024 users
tiancaiamao Jan 22, 2025
9d737ae
use loadAll instead of loadSome when active user list is long
tiancaiamao Feb 11, 2025
abf500d
use strings.Clone() to avoid leak
tiancaiamao Feb 12, 2025
a6778f3
save
tiancaiamao Feb 12, 2025
b271b17
Merge branch 'master' into test
tiancaiamao Feb 12, 2025
c2de01e
cleanup
tiancaiamao Feb 12, 2025
9524598
change to the old streaming API
tiancaiamao Feb 13, 2025
8edfea0
make lint happy
tiancaiamao Feb 13, 2025
36e89dd
fix test build
tiancaiamao Feb 13, 2025
8790c11
fix CI
tiancaiamao Feb 13, 2025
55b66fc
fix panic
tiancaiamao Feb 14, 2025
9e92ab1
address comment
tiancaiamao Feb 14, 2025
132eca4
typo
tiancaiamao Feb 14, 2025
1c4bd0f
Update pkg/privilege/privileges/cache.go
tiancaiamao Feb 17, 2025
40bfc62
address comment
tiancaiamao Feb 17, 2025
63e2acc
address comment
tiancaiamao Feb 17, 2025
7da3fb9
Merge branch 'master' into test
tiancaiamao Feb 17, 2025
4885ebd
Merge branch 'master' into test
tiancaiamao Feb 26, 2025
2641671
Merge branch 'master' into test
tiancaiamao Feb 26, 2025
a540deb
merge master and resolve conflict
tiancaiamao Feb 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/domain/domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -1893,7 +1893,7 @@ func (do *Domain) LoadPrivilegeLoop(sctx sessionctx.Context) error {
if err != nil {
return err
}
do.privHandle = privileges.NewHandle(sctx.GetRestrictedSQLExecutor(), sctx.GetSessionVars().GlobalVarsAccessor)
do.privHandle = privileges.NewHandle(do.SysSessionPool(), sctx.GetSessionVars().GlobalVarsAccessor)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

RestrictedSQLExecutor does not meet our requirement, to use ExecuteInternal API we need to pass session instead.


var watchCh clientv3.WatchChan
duration := 5 * time.Minute
Expand Down
Loading