Skip to content

Cg standalone impl - #1337

Open
geoffrey1330 wants to merge 17 commits into
mainfrom
cg-standalone-impl
Open

geoffrey1330 wants to merge 17 commits into
mainfrom
cg-standalone-impl

Conversation

@geoffrey1330

Copy link
Copy Markdown
Collaborator

No description provided.

geoffrey1330 and others added 2 commits September 10, 2026 14:46
…(Phase 1)

Decouple the consistency group from replication policies and add the
standalone surface the design's Phase 1 calls for:

- model: ConsistencyGroup gains a cluster-unique name; policy_id optional.
  LVol gains a denormalized group_id pointer (set at join, cleared at detach).
- controller: extract group-first cores (ensure_group idempotent by name,
  add_member_to_group, remove_member_from_group, create_group_snapshot_for_group
  with an explicit health precheck naming offline/off-store members) that the
  policy path now calls as thin wrappers; new list_members, list_generations
  (expected-vs-present), delete_generation, clone_generation.
- volume create: consistency_group field ensures the group, pins placement,
  and joins the member atomically. Volume delete closes the epoch while
  preserving prior-generation snapshots.
- snapshot listing surfaces group_id/group_seq and a --consistency-group filter.
- web v2: new /consistency-groups router (summary, members, take/list/get/delete
  generation, detach); volume create/read and snapshot list extended.
- CLI: new consistency-group command group plus --consistency-group flags.
- tests: epoch math, ensure-by-name idempotency + convergence, precheck,
  incomplete-generation, delete-preserves, clone-forms-group. tox lint/types
  green; full unit suite 2805 passed.

Refs design-consistency-groups.md §4-§8, §10.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The Go control-plane client's do() treats every 201 as a Location-header
creation and extracts a UUID; the take-generation endpoint instead returns
the generation representation as a JSON body, so it must be 200.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Comment thread simplyblock_web/api/v2/_dtos.py Fixed
Comment thread simplyblock_web/api/v2/cluster/consistency_group.py Fixed
Comment thread simplyblock_core/controllers/lvol_controller.py Fixed
geoffrey1330 and others added 11 commits September 10, 2026 15:41
The group snapshot freezes I/O across every member for one
bdev_lvol_snapshot_group call, so an unbounded group would freeze
arbitrarily many volumes and widen the all-or-nothing rollback surface.

- MAX_CONSISTENCY_GROUP_MEMBERS = 20 in constants.
- add_member_to_group rejects a join past the cap (authoritative for both
  the label path and the legacy policy path); the cap counts open epochs, so
  a detached member frees its slot.
- add_lvol_ha rejects the 21st member before the lvol is created, so a full
  group never leaves an orphan volume.
- tests: 21st member rejected, detached member frees a slot.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… crashed services); pin all import orders with a test
…fault (1) as a dictated nsid and failed on shared subsystems whose slot 1 was taken
… _CloneParams and clone(), join_new_volume helper (design §7.2)
…unted forever — removed_seq=0 collides with the open-epoch sentinel; drop entries no generation contains
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
rec = db.get_snapshot_by_id(snap_id)
db.unindex_snapshot(rec)
rec.remove(db.kv_store)
except Exception:
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