greptimedb icon indicating copy to clipboard operation
greptimedb copied to clipboard

System table in distribute mode

Open v0y4g3r opened this issue 2 years ago • 2 comments

Background

In standalone mode, datanode creates system table and regions during it's first startup, and registers these tables to catalog. But in distributed mode, all regions of system tables should be treated equally. For example , for system table scripts, when frontend received a insert into scripts request, it should forward the create request to all datanodes, instead of forwarding by partition rules.

Proposal

Frontend should be able to distinguish system table request. System table names should be retrived from metasrv.

For insert request, system table insert requests should bypass current writer splitter logic and forward to all datanodes. https://github.com/GreptimeTeam/greptimedb/blob/5abff7a536ece42cbe53e96c4205b9625e923a49/src/frontend/src/spliter.rs#L19

For query requests, we should implement a SystemTableScan exec plan that forwards request to all datanodes.

API change

Not applicable.

v0y4g3r avatar Nov 07 '22 07:11 v0y4g3r

Maybe we can create another table implementation in frontend just for system table? The new table implementation act as a "fan-out" adapter to its designated tables, and loop through them upon writing and reading.

MichaelScofield avatar Nov 28 '22 03:11 MichaelScofield

Maybe we can create another table implementation in frontend just for system table? The new table implementation act as a "fan-out" adapter to its designated tables, and loop through them upon writing and reading.

I think it's more like a specialized physical plan that scans all regions (from all datanodes), maybe we should add a optimize rule for this.

v0y4g3r avatar Nov 28 '22 06:11 v0y4g3r