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

planner: simplify StatsHandler and break it down into multiple smaller and simpler sub-modules #46905

Closed
qw4990 opened this issue Sep 12, 2023 · 3 comments
Assignees
Labels
affects-7.5 component/statistics report/customer Customers have encountered this bug. sig/planner SIG: Planner type/enhancement The issue or PR belongs to an enhancement.

Comments

@qw4990
Copy link
Contributor

qw4990 commented Sep 12, 2023

Enhancement

As you can see from the diagram below, the StatsHandler(statistics/handle/handle.go:Handle) structure is too complex.
Actually, there are multiple features(modules) decoupled in it, which makes it hard to maintain and evolve.
And these features rely on memory to synchronize information, which brings some risks like whether to lock or not when accessing some fields, which methods be thread-safe, how to synchronize information with other nodes.

To make it easier to maintain, we'd better break it down since obviously maintaining multiple smaller and simpler modules is safer than maintaining a big and complex module.
And only allow them to synchronize information through the storage to avoid consensus problems and thread-safe issues.

image

@qw4990 qw4990 added type/enhancement The issue or PR belongs to an enhancement. sig/planner SIG: Planner component/statistics labels Sep 12, 2023
ti-chi-bot bot pushed a commit that referenced this issue Sep 13, 2023
ti-chi-bot bot pushed a commit that referenced this issue Sep 14, 2023
ti-chi-bot bot pushed a commit that referenced this issue Sep 18, 2023
@qw4990
Copy link
Contributor Author

qw4990 commented Sep 19, 2023

Handle.mu should be removed, see #47051:

fe247aa0-da36-4d27-bb15-2ec1a85c8c98

@hawkingrei
Copy link
Member

I think it has been completed.

@seiya-annie
Copy link

/found customer

@ti-chi-bot ti-chi-bot bot added the report/customer Customers have encountered this bug. label Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-7.5 component/statistics report/customer Customers have encountered this bug. sig/planner SIG: Planner type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

No branches or pull requests

4 participants