fix chart display error in basic architecture#56
Merged
lzjqsdd merged 1 commit intoApr 27, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
sidebar_position: 1
Basic Architecture
This document describes the core components and data flow of Curvine as implemented in the codebase: Master (metadata and Raft), Worker (block storage), and Client (read/write paths).
Overview
Curvine is a distributed file cache layer. The Master manages metadata and block placement; Workers store block data and serve read/write; Clients (FUSE, SDK, CLI, S3 gateway) talk to Master for metadata and to Workers for data. Metadata is replicated via Raft for high availability.
%%{init: {'theme': 'base', 'themeVariables': { 'background': '#ffffff', 'primaryColor': '#4a9eff', 'primaryTextColor': '#1a202c', 'primaryBorderColor': '#3182ce', 'lineColor': '#4a5568', 'secondaryColor': '#805ad5', 'tertiaryColor': '#38a169', 'mainBkg': '#ffffff', 'nodeBorder': '#4a5568', 'clusterBkg': '#f8f9fa', 'clusterBorder': '#dee2e6', 'titleColor': '#1a202c'}}}%% flowchart LR subgraph Client_Layer["Client layer"] FUSE[FUSE] SDK["SDK / CLI"] S3["S3 Gateway"] end subgraph Master_Layer["Master (Raft group)"] Leader["Leader<br/>Metadata · Journal"] Follower["Follower(s)<br/>Replay journal"] Leader -. Raft .-> Follower end subgraph Worker_Layer["Workers"] W1["Worker 1<br/>Block storage"] W2["Worker 2<br/>Block storage"] end FUSE --> Leader SDK --> Leader S3 --> Leader FUSE --> W1 SDK --> W2 Leader --> W1 Leader --> W2 classDef appStyle fill:#ed8936,stroke:#c05621,color:#fff,stroke-width:2px classDef masterStyle fill:#4a9eff,stroke:#2b6cb0,color:#fff,stroke-width:2px classDef workerStyle fill:#805ad5,stroke:#553c9a,color:#fff,stroke-width:2px class FUSE,SDK,S3 appStyle class Leader,Follower masterStyle class W1,W2 workerStyleMaster
The Master is the control plane: it holds the file system metadata (directory tree, file inodes, block locations), manages Worker registration, and allocates blocks for writes. For high availability, multiple Master nodes form a Raft group; only the leader serves metadata write RPC; followers replay the journal to keep state in sync.
Leader (Active Master)
Mkdir,CreateFile,AddBlock,CompleteFile,Rename,Delete,Mount,UnMount). The leader appends entries to the Raft log; once committed, they are applied to the in-memory metadata tree (FsDir).MasterHandlerserves RPC;MasterFilesystemandFsDirhold the directory/file and block mapping;JournalWriterwrites entries;WorkerManagertracks Workers and block placement;MountManagermanages UFS mount points.Standby Master (Follower)
JournalLoaderapplies each committedJournalEntryto the localFsDir(e.g.mkdir,create_file,add_block,complete_file,rename,delete,mount,unmount). This keeps standby state identical to the leader.Raft
RocksLogStorage). The journal is the application payload carried in Raft log entries.MasterMonitorexposes whether the current node is active:is_active()is true only when the Raft role is Leader. The client or upper layer should route metadata write requests to the current leader (e.g. by resolving the leader from the cluster config or a router).Workers
Workers store block data and serve block read/write RPC. They do not hold file system metadata; they only manage blocks identified by block ID.
Registration and heartbeat
HeartbeatStatus: Start, Running, End). The Master’sWorkerManagermaintains aWorkerMapandBlockMap(which blocks are on which worker).Block storage
ReadHandlerreceives block-read RPCs, opens the block file, and returns data (with optional read-ahead and sendfile-style optimizations).Replication (optional)
MasterReplicationManager): when multiple replicas are required, the Master coordinates copying block data from one Worker to others. Replication is configurable (e.g. concurrency limit, on/off).Client
The client is any component that uses the Curvine file system: FUSE, Rust/Java/Python SDK, CLI (
cv), or S3 gateway. It always talks to the Master for metadata and to Workers for block data.Read path
FileBlocks(file status + list of block locations).Write path
Write behavior depends on the mount write type (for UFS mounts) or the native Curvine path:
AddBlock,CompleteFile), and returns block locations to the client.For native Curvine paths (non-UFS), writes go to Workers and are recorded in the Master journal; replication is handled by the Master/Worker replication logic when configured.
Summary
For deployment topology and startup order, see Deployment Architecture. For UFS and cache semantics, see Data Orchestration and Cache.