Skip to content

[Paper/M2][P0][RFC] Decouple shared snapshot lowers from per-workspace writable overlays #51

Description

@Ivanbeethoven

Parent research epic: #39

背景

当前 Antares 为每个 workspace 创建独立 AntaresFuse 和 FUSE session。即使用户态 Dicfuse 对象可共享,每个 workspace 仍承担独立 mount handshake、内核 dentry/attr cache、background warmup 和 teardown。

系统论文需要一个比“共享 daemon/cache”更强的机制:

昂贵的 remote/Dicfuse lower 与 kernel-facing lower mount 按唯一 SnapshotId 复用;workspace 只创建轻量可写 delta view。

Research Invariant

对于 N 个 workspace 和 U 个唯一 SnapshotId:

number_of_remote_lower_instances = O(U)
number_of_snapshot_lower_FUSE_sessions = O(U)
number_of_private_upper_layers = O(N)

必须先完成架构 Bakeoff

Option A — SnapshotMountPool + kernel OverlayFS

  • 每个 SnapshotId 建立一个共享只读 Dicfuse mount;
  • 每个 workspace 使用相同 lowerdir 和私有 upper/workdir;
  • workspace 通过独立 mount namespace 只看到自己的 overlay;
  • 复用 lower 的 kernel page/dentry cache。

Option B — Multiplexed FUSE supermount

/private/scorpio-supermount/<workspace-id>/...
  • 单一长生命周期 FUSE connection;
  • daemon 根据 workspace-id 路由到不同 upper + shared snapshot;
  • 对外通过 bind mount/mount namespace 暴露单个子树。

Option C — Current per-workspace FUSE

保留为兼容 fallback 和实验 baseline。

Bakeoff Metrics

  • workspace provision/delete P50/P95/P99;
  • FUSE connection/session 数;
  • lower page/dentry cache 复用;
  • daemon CPU/RSS;
  • mount namespace 与权限复杂度;
  • copy-up/rename/whiteout 语义;
  • open-handle 和 refresh 语义;
  • kernel/发行版兼容性;
  • crash cleanup;
  • 跨 workspace 隔离。

Tasks

  • 写 ADR,明确三种方案和选择标准;
  • 分别实现最小 Option A/Option B prototype;
  • 使用 Issue 2 harness 进行 1/16/64 workspace 对比;
  • 选择一个生产实现;
  • 实现 SnapshotMountPool 或等价 abstraction;
  • pool entry 按 SnapshotId key,带 refcount、pin 和 idle TTL;
  • workspace 创建只分配 upper/manifest 和轻量 view;
  • workload 不得看到 sibling workspace;
  • refresh 时可切换 workspace 对应 snapshot generation;
  • 最后一个引用释放后延迟回收 snapshot lower;
  • daemon crash 后清理 stale mount;
  • 保留 legacy Antares per-job mode;
  • 增加 capability 和配置开关;
  • 记录 active snapshots、workspaces、FUSE sessions 和 reuse ratio。

Functional Acceptance Criteria

  • 64 个 workspace 基于同一 SnapshotId 时,只存在一个共享 snapshot lower 实例;
  • 每个 workspace 有独立 upper 和 delta manifest;
  • 一个 workspace 的 write/delete/rename 对其他 workspace 不可见;
  • unmount 一个 workspace 不影响其他 workspace;
  • snapshot lower 回收不会破坏仍存在的 workspace/open handle;
  • refresh semantics 与 Issue 5 一致;
  • legacy mode 和新模式都通过相同 POSIX regression suite。

Paper Retention Gate

该机制只有满足至少一项才进入论文核心贡献:

  • 在 64 workspace warm-snapshot 场景下,P95 provisioning latency 相比当前模式降低至少 5×;
  • 或 daemon CPU/RSS/FUSE-session 开销降低至少 3×;
  • 或端到端并发 build throughput 提升至少 25%。

若未达到,保留 bakeoff 作为负结果,不围绕此机制构造主 claim。

Relevant Files

src/antares/fuse.rs
src/antares/mod.rs
src/daemon/antares.rs
src/server/
deploy/

Dependencies

Issue 3、Issue 4、Issue 7;Issue 5 的 generation semantics 必须已稳定。


Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions