Skip to content

Tracking issue for implementing mito as a region engine #1869

Closed
@evenyag

Description

What type of enhancement is this?

Refactor, Tech debt reduction

What does the enhancement do?

For historical reasons, both frontend and table engines (run in datanode) are aware of multiple regions in a table. That makes implementing a distributed table with multi-regions support complicated. We need to deal table and its regions on both frontend and datanode. We also need to implement procedures for the mito engine to ensure the eventual consistency of altering a table.

We decide to turn the table engine into a region engine, which only has knowledge of regions.

  • The TableEngine trait becomes RegionEngine and only deals with regions.
  • The datanode acts like a RegionServer. It manages regions assigned to the node and provides region-level access.
  • The frontend provides table-level access. It partitions requests and routes them to regions on datanodes.
  • We can combine the StorageEngine with the mito table engine.
  • Since we already store metadata of the table in metasrv, there is no need to persist them again to the table manifest. We can remove the table manifest.
  • Altering multiple regions is tracked by the procedure inside metasrv. We don't need procedures for the mito engine.

Steps

We are going to create a new fork of mito crate (maybe mito2).

Other Enhancements

There are also some other enhancements we could achieve during refactoring mito. They may not be strictly related to this issue's topic.

  • Remove dependency of log sequence from RegionMetaAction::Change
  • Decouple LogStore index and engine sequence (switch to sequence per key mode)
  • Remove Option from time range in FileMeta
  • Implement a new RegionWriter that supports batching (group commit)
  • Add column family support? We plan to remove column family

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions