Skip to content

S1 partial replication - #19

Draft
adammccartney wants to merge 3 commits into
EESSI:mainfrom
adammccartney:s1-partial-replication
Draft

adammccartney wants to merge 3 commits into
EESSI:mainfrom
adammccartney:s1-partial-replication

Conversation

@adammccartney

@adammccartney adammccartney commented Aug 24, 2026 •

Copy link
Copy Markdown

This adds some ansible tasks to the eessi.cvmfs role that enables partial the partial replication feature introduced by cvmfs v2.14.0.

usage:

  - name: Configure CVMFS stratum1 replicas
    hosts: stratum1
    become: true
    roles:
      - role: eessi.cvmfs

    vars:
      cvmfs_repositories:
        - repository: software.eessi.io
          stratum0: aws-eu-west-s1-sync.eessi.science
          # Replicate only the zen4 and zen5 architecture trees (nested
          # catalog roots) instead of the full repository. Requires CVMFS
          # 2.14.0+ on the stratum1.
          partial_replication:
            enabled: true
            paths:
              - /versions/*/software/linux/x86_64/amd/zen3
              - /versions/*/software/linux/x86_64/amd/zen4
              - /versions/*/software/linux/x86_64/amd/zen5
              - /versions/*/compat/linux/x86_64

        # Repository without partial_replication keeps the previous
        # behavior: a full (unfiltered) replica.
        - repository: full.mirror.example
          stratum0: http://stratum0.example.com

Note: the anisble code in this PR was generated using the pi coding agent running deepseek-v4-flash-284b

Add optional per-repository partial replication configuration to the
stratum1 role, inserted between the server options include and the
initial snapshot is already partial.

Driven by an optional per-repo dict:
  cvmfs_repositories[*].partial_replication:
    enabled: true
    paths: [/software/linux/x86_64/amd/zen4, /software/linux/x86_64/amd/zen5]

When enabled it writes partial-replication.spec (version 1 + paths) and
sets CVMFS_PARTIAL_REPLICATION=true and CVMFS_PARTIAL_REPLICATION_SPEC in
the repo server.conf before the initial snapshot. When not enabled (or
enabled: false) it removes that config, restoring full-sync fallback.

Partial replication requires CVMFS 2.14.0+.

Co-Authored-by: Pi (asc/moonshotai/Kimi-K3) <pi-coding-agent>
Ansible rejects 'loop' on a block, which made the full-sync fallback
cleanup fail at runtime. Split it into two plain tasks, each carrying
its own loop/when.
@adammccartney
adammccartney marked this pull request as draft August 24, 2026 12:51
@adammccartney
adammccartney force-pushed the s1-partial-replication branch from 07e0abc to 230ff8d Compare August 26, 2026 14:43
Add optional per-repository client configuration for consuming a
partial Stratum 1 (CernVM-FS >= 2.14.0), driven by:

  cvmfs_repositories[*].partial_replica_client:
    enabled: true
    mode: failover | fail
    server_url: ...          # optional per-repo override
    full_stratum1_url: ...   # required for failover

For enabled repos it writes /etc/cvmfs/config.d/<fqrn>.local with
CVMFS_PARTIAL_REPLICA_MODE, CVMFS_FULL_STRATUM1_URL (failover) and an
optional CVMFS_SERVER_URL override pointing at the partial replica.
config.d/<fqrn>.local is parsed last in the client config chain, so it
overrides domain-level settings; the file is treated as fully managed.
Disabled or absent config removes the file (full-replica fallback).

Note: repositories.d/<fqrn>/client.conf (used by client_options) is NOT
read by the client mount chain (see OptionsManager::ParseDefault), so
partial replica parameters must not go there.

Co-Authored-by: Pi (asc/moonshotai/Kimi-K3) <pi-coding-agent>
@adammccartney
adammccartney force-pushed the s1-partial-replication branch from 230ff8d to a036c85 Compare August 26, 2026 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant