The current binary starts all-in-one, be, proxy, cell-manager, and global-manager when that role's configuration is valid. A second all-in-one process can join the same cell. proxy dials the registered cell that contains a metadata call, ExecuteSql, or a user-key transaction, and fails closed otherwise. Those calls are not sent to [cluster] upstream. The disaggregated production topology is still a design target, not a deployment this repository runs. The 100B–10T+ range is a design model, not a measurement of this repository. Trillion-scale figures in arXiv:2610.32247v1 are Baidu production metrics, not results of this repository.
What this tree runs: persistent LSM, Raft replication, same-process shard splits, and all-in-one gRPC/CLI have tests in this workspace.
all-in-one,be,proxy,cell-manager, andglobal-managerstart when the configuration is valid.proxydials a registered cell for a contained metadata call,ExecuteSql, or user-key transaction and fails closed otherwise. Jumbo isolation is a route flag and does not move peer shards. See correctness notes.
[已实现] means one metadbd --role all-in-one process in current source. It is not a multi-cell deployment. MetaDbEngine::new_single_node is an in-memory simulator with no disk and no Raft, not this process.
在单机一体化模式下,GlobalManager、CellLocalManager、MetaCache、Proxy 与 BE 存储引擎运行于同一进程,底层采用 1-Voter OpenRaft。由于分段 CRC32C .raftlog 已经提供顺序写崩溃持久化保障,底层 LSM 引擎彻底关闭本地 KV WAL,避免双重写日志开销。
[node]
node_id = 1
role = "all-in-one"
data_dir = "/var/lib/metadb"
grpc_listen_addr = "127.0.0.1:7800"
metrics_listen_addr = "127.0.0.1:9100"
[clock]
max_clock_drift_ms = 500
[storage]
memtable_size_bytes = 33554432 # 32 MiB
block_cache_bytes = 536870912 # 512 MiB(16 分片 LRU 块缓存)
mvcc_retention_ms = 5000 # 5 秒内存 MVCC 保留窗口
bloom_bits_per_key = 10
locality_tombstone_threshold = 128
locality_tombstone_ratio = 0.50
[sharding]
bootstrap_table_shards = true # 初始化表前缀根分片:1(Meta)、2(Quota)、3(SecondaryIndex)
shard_split_threshold_bytes = 4294967296 # 4 GiB 分片分裂阈值
[security]
# Loopback development only. Literal 127.0.0.1. Remove this flag when you set shared_secret.
allow_unauthenticated = trueThe toolchain is Rust 1.100.0 (rust-toolchain.toml). all-in-one, be, proxy, cell-manager, and global-manager start when the configuration is valid. An invalid combination fails before listen.
The [security] block above is the explicit loopback development opt-in. It is not a credential. grpc_listen_addr and metrics_listen_addr stay on the literal IP 127.0.0.1. The hostname localhost is not accepted for allow_unauthenticated. An empty secret without that flag does not start the process.
metadbd --config /etc/metadb/standalone.tomlTo require authorization: Bearer <secret> on metadata, transaction, control-plane, Raft transport, and GET /metrics, replace that [security] block. Do not leave allow_unauthenticated in the file. Both together are rejected. A whitespace-only shared_secret is rejected even if the flag remains. Peer Raft clients send the same token. metadb-ctl --auth-token (or METADB_AUTH_TOKEN) and metadbd --join / --cell-manager send that header.
[security]
shared_secret = "replace-with-a-long-random-string"[已实现] means in-process PID-boundary splits inside that same all-in-one process. It is not a multi-host topology. Jumbo isolation is a route flag and does not move peer shards.
当分片容量超过 shard_split_threshold_bytes 时,PolicyShardSplitter 会扫描 SSTable 块索引中点并严格沿着 group_key = PID([0x01][pid: 8B BE])边界执行原子分裂:
- 同一目录的属性记录
(PID, "_attr_")与所有直接子项(PID, child_name)始终保持在同一分片内。 - 单机上的多个 OpenRaft 分片组可并行刷盘与压缩,充分压榨多核与 NVMe 多队列吞吐。
Stage 3 is a design target. The current binary does not deploy it.
metadbd starts --role all-in-one, be, proxy, cell-manager, and global-manager when that role's configuration is valid. proxy dials the registered cell that contains a metadata call, ExecuteSql, or a user-key transaction, and returns a placement error otherwise. Those calls are not sent to [cluster] upstream. CommitPrimary2pc, ApplyAuxBatch, ForwardRouter, and GetRoutes may still use that upstream. AllocateIdBlock is refused. This is not a production MetaCache of every shard and not a disaggregated production deployment.
A second metadbd --role all-in-one can join the same cell when --join or --cell-manager names the current leader and the data directory is fresh. That path is covered by crates/metadb-server/tests/join_existing_group.rs. The joiner is still an all-in-one process. It is not a role-trimmed backend, and the join does not create another cell. See Operations.
metadbd --role be hosts local Raft replicas. It is not a remote disk that a cell manager places a shard onto by itself. metadb-ctl raft scale-replicas calls ScaleShardReplicas and requires the requested voter count to already be registered in the cell. A fresh all-in-one cell has one node, so --target-voters 3 fails until those nodes exist. The constraints are in Operations.
100B – 10T+ is a design-model range: arithmetic for how a future multi-cell topology might be sized. It is not a record count this repository has stored. It is also not a Baidu production figure claimed as a result of rustfs/MetaDB. Baidu's published sizes, including the BOS2 figure of 1.848 trillion records in arXiv:2610.32247v1, are Baidu production metrics, not results of this repository.
这张表是设想中的角色划分。配置有效时,这个二进制会启动这些角色名。它不做表里的拆分生产职责:单元管理器把分片放到其他机器上,或全局管理器自己成为 Raft 组。proxy 会选择包含元数据调用、ExecuteSql 或带用户键事务的已注册单元,否则失败关闭。这种选择不是覆盖全部分片的生产 MetaCache。本树里的巨型隔离是路由标志。它不会把对等分片移到专用主机上。
| Role | Design --role |
Intended responsibility |
|---|---|---|
| Global Manager | global-manager |
Would map coarse [start_key, end_key) intervals to CellId, allocate 65,536-ID blocks, and coordinate cross-Cell directory rename leases. |
| Cell Local Manager | cell-manager |
Would process BE heartbeats (20K–50K shards/Cell) and orchestrate PID splits and membership changes. |
Backend Storage (BE) |
be |
Would host Multi-Raft shard groups and the LSM engine on NVMe hosts. |
| Stateless Proxy | proxy |
Would embed MetaCache, compile the 20 SQL templates, and coordinate cross-shard 2PC. |
metadb-ctl cell register 调用 RegisterCell。没有 --start-key 和 --end-key 时它发送 [01, 04),这会与默认单元重叠并以非零状态退出。带上这些键时,只有端点路由覆盖该范围才会保存该单元。此后被该单元包含的请求会转发到已保存的端点。