-
Notifications
You must be signed in to change notification settings - Fork 205
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 Cluster and Catalog mods #235
Comments
@waynexia 👍 I can't agree more with this proposal. |
During the development, I find it is hard to combine the Here is the new proposal, which will still keep the
As for the create/drop table procedure, a new proxy called TableCreator will be added to handle different cases:
Here is the tracking task:
|
Describe This Problem
A rough dependency graph of related structures:
Cluster
andCatalogManager
are public, they may be used byClient
orCeresMeta
to modify catalog information (create, open or delete tables). This graph shows two paths of creating/droping a table. The green one is triggered by server itself and another orange one is triggered byCeresMeta
CatalogManager
can create/drop tables when it has write access (the leader role).3-1
in this path is notifyingCeresMeta
that a new table has been created, and3-2
is an operation that happens simultaneously that create/drop that table in the leader itself.This path can be treated as counter part of the green one.
CeresMeta
may notify non-leader node that something has changed. It also goes throughEventHandler
to notifyCluster
and let it take action.Proposal
From my first impression, the dependency and call graph is complicated. I'd like to change relative parts in the following ways:
Combine
VolatileCatalog
andCluster
CombineVolatileCatalog
andCluster
#245Cluster
is responsible to manageTable
s andShard
s whileCatalog
is responsible to manageSchema
s which is a group of tables in another perspective different fromShard
. Their functionalities have a big part that overlaps. It's natural to implement bothCluster
andCatalog
traits over one struct, so they can use one memory state and maybe one operation logic.SchemaIdAlloc
andTableIdAlloc
refactor: removeSchemaIdAlloc
andTableIdAlloc
#238Id
should be allocated byCeresMeta
, not the server. And furthermore, the server does need not to allocate ID then create table. The entire procedure is accomplished byCeresMeta
.MetaClient
Current
MetaClient
provides two functionalities: poll update fromCeresMeta
and invokeCeresMeta
's method. These correspond to the two ways above: green arrows are from server toCeresMeta
and orange are fromCeresMeta
to server. We can split these two aspects, by makingMetaClient
an actual client that invokes RPC toCeresMeta
and anEventloop
that keeps fetching updates fromCeresMeta
. This can also resolve the cyclic dependency betweenCluster
andMetaClient
.Due to #235 (comment), here are the new tracking tasks:
Additional Context
No response
The text was updated successfully, but these errors were encountered: