-
Notifications
You must be signed in to change notification settings - Fork 328
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
refactor: system tables in new region server #2344
refactor: system tables in new region server #2344
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## migrate-region-server #2344 +/- ##
========================================================
Coverage ? 77.54%
========================================================
Files ? 724
Lines ? 115145
Branches ? 0
========================================================
Hits ? 89292
Misses ? 25853
Partials ? 0 |
There are some conflicts. |
0e82153
to
c918887
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
5f7d118
// There are two sources for finding a table: the `local_catalog_manager` and the | ||
// `table_metadata_manager`. | ||
// | ||
// The `local_catalog_manager` is for storing tables that are often transparent, not saving any | ||
// real data. For example, our system tables, the `numbers` table and the "information_schema" | ||
// table. | ||
// | ||
// The `table_metadata_manager`, on the other hand, is for storing tables that are created by users, | ||
// obviously. | ||
// | ||
// For now, separating the two makes the code simpler, at least in the retrieval site. Now we have | ||
// `numbers` and `information_schema` system tables. Both have their special implementations. If we | ||
// put them with other ordinary tables that are created by users, we need to check the table name | ||
// to decide which `TableRef` to return. Like this: | ||
// | ||
// ```rust | ||
// match table_name { | ||
// "numbers" => ... // return NumbersTable impl | ||
// "information_schema" => ... // return InformationSchemaTable impl | ||
// _ => .. // return DistTable impl | ||
// } | ||
// ``` | ||
// | ||
// On the other hand, because we use `MemoryCatalogManager` for system tables, we can easily store | ||
// and retrieve the concrete implementation of the system tables by their names, no more "if-else"s. | ||
// | ||
// However, if the system table is designed to have more features in the future, we may revisit | ||
// the implementation here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- those are not doc comment
- add
,ignore
to the block language, otherwise it will become an uncompileable doc test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
intentionally not made them doc comments because they are not relevant to how to use this FrontendCatalogManager
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does that local
mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not real tables that will be persisted in the kv backend which the TableMatadataManager in the FrontendCatalogManager proxied to
refactor: inverse the dependency between system tables and catalog manager
refactor: inverse the dependency between system tables and catalog manager
refactor: inverse the dependency between system tables and catalog manager
refactor: inverse the dependency between system tables and catalog manager
refactor: inverse the dependency between system tables and catalog manager
I hereby agree to the terms of the GreptimeDB CLA
What's changed and what's your intention?
This PR mainly refactor the dependency between system tables and catalog manager. Now system tables (numbers table and information schema table) will be injected to a local memory catalog in FrontendCatalogManager (other ordinary user tables are initialized from kv backend).
I'm trying to get rid of LocalCatalogManager. Will unify catalog managers to FrontendCatalogManager afterwards.
Checklist
Refer to a related PR or issue link (optional)