Skip to content

feat(dialect-rustfs-admin): register pool maintenance and hot-reload native routes - #1669

Open
loverustfs wants to merge 1 commit into
mainfrom
feat/pool-hot-reload-maintenance
Open

loverustfs wants to merge 1 commit into
mainfrom
feat/pool-hot-reload-maintenance

Conversation

@loverustfs

@loverustfs loverustfs commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Registers the 6 new RustFS pool maintenance mode and zero-downtime live hot-reload Admin v3 routes in the native RustFS admin route inventory (rustfs_admin_routes_native.json, 413 -> 419 routes) and generates their rustfs-gateway-dialect-rustfs-admin native operations:

  • GET /rustfs/admin/v3/pools/maintenance/status (MultipleActions: any_of(["admin:ServerInfo", "admin:Decommission"]))
  • POST /rustfs/admin/v3/pools/maintenance/enter (sigv4-admin: admin:Decommission)
  • POST /rustfs/admin/v3/pools/maintenance/exit (sigv4-admin: admin:Decommission)
  • POST /rustfs/admin/v3/pools/config/check (sigv4-admin: admin:Decommission)
  • POST /rustfs/admin/v3/pools/preflight (sigv4-admin: admin:Decommission)
  • POST /rustfs/admin/v3/pools/reload (sigv4-admin: admin:Decommission)

Also aligns mfa_mutation("/rustfs/admin/v3/account/mfa/enroll", true) with upstream AccountMfaEnrollHandler's step-up request body, and extends scripts/rustfs_metadata_listing_routes.py (native_claimed_routes) with fail-closed validation for AuthRequirement::any_of(...) on native control-plane operations.

Companion PRs:

Verification

$ cargo fmt --all --check
$ cargo run -p xtask -- rustfs-admin-dialect --check
rustfs-admin-dialect: 381 generated file(s) are current
$ cargo test -p xtask -- rustfs_admin_dialect
test result: ok. 73 passed; 0 failed; 0 ignored
$ cargo test -p rustfs-gateway-dialect-rustfs-admin
test result: ok. 2 passed; 0 failed (unit) / 85 passed; 0 failed (integration)
$ cargo test -p rustfs-gateway-goldens -- rustfs_admin
test result: ok. 208 passed; 0 failed
$ python3 -m unittest scripts/test_metadata_listing_routes.py scripts/test_admin_route_variants.py
Ran 62 tests ... OK
$ python3 scripts/check_gateway_admin_census.py --gateway .
pinned gateway native inventory: 419 routes
RustFS collector output: 419 routes

Role Verdicts

  • simplicity-adversary: attacked native admin route rulings, any_of collector parser in scripts/rustfs_metadata_listing_routes.py, and generated dialect-rustfs-admin native op modules — no break found

Breaking Change

  • BREAKING — this PR touches a protected file or changes a public contract.

Checklist

  • The four-command gate passed (fmt, clippy, test, cargo xtask verify)
  • New or changed public API has rustdoc
  • Negative test cases outnumber positive ones
  • Every new assertion was mutated — the implementation was broken on purpose and the assertion
    went red. The PR description names which ones (native_pool_maintenance_status_is_any_of_server_info_and_decommission, native_dialect_assembles_and_declares_pool_maintenance_and_hot_reload_routes, test_eighteen_native_routes_with_pool_maintenance_any_of_and_decommission_actions)
  • No Protected File touched; if one was, the PR description contains BREAKING and a migration path
  • No unsafe introduced
  • No inventory / linkme introduced
  • No #[non_exhaustive] added to a DTO
  • No s3s code copied; behavioural evidence is URL + self-written summary
  • No credentials, signatures, or expected-signature values reachable from logs or error bodies
  • No plan document, analysis report, or working note committed
  • Commits follow Conventional Commits; PR title ≤72 characters
  • A Handoff comment has been appended to the issue

@overtrue overtrue left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the generated dialect, inventory, and validator changes in this PR:

Code Assessment

  • Admin v3 Pool Maintenance & Hot-Reload Routes (crates/goldens/src/migration_inventory/rustfs_admin_routes_native.json, crates/dialect-rustfs-admin/src/native/ops/get_v3_pools_maintenance_status.rs, post_v3_pools_*.rs): Route count (413 -> 419), MultipleActions (anyOf(admin:ServerInfo, admin:Decommission)) on GET /rustfs/admin/v3/pools/maintenance/status, sigv4-admin (admin:Decommission) with buffered bodies on the 5 POST routes, and census assertions in crates/dialect-rustfs-admin/tests/integration/census.rs are consistent.
  • MFA Enroll Body Alignment (xtask/src/rustfs_admin_dialect/rulings.rs, crates/dialect-rustfs-admin/src/native/ops/post_v3_account_mfa_enroll.rs, xtask/src/rustfs_admin_dialect/form_tests.rs): Updating mfa_mutation("/rustfs/admin/v3/account/mfa/enroll", true) to RequestBodyMode::Streaming (caller_secret: true) aligns cleanly with AccountMfaEnrollHandler.
  • any_of Native Authority Validation (scripts/rustfs_metadata_listing_routes.py, scripts/test_metadata_listing_routes.py): native_claimed_routes properly validates AuthRequirement::any_of(...), ensures >= 2 distinct actions, checks wire-to-AdminAction variant mappings, and fails closed if the wildcard arm does not return AccessDenied.

Blocking Issue

  • CI Static checks (Role verdicts) failed (mergeStateStatus: BLOCKED): scripts/check_role_verdicts.sh requires a visible ## Role Verdicts section in the PR description, followed by a fresh pull-request event (e.g., an empty/follow-up commit after editing the PR body) so the workflow re-evaluates with the updated payload.

Once ## Role Verdicts is added and Static checks passes, this is ready to approve and merge.

@loverustfs
loverustfs force-pushed the feat/pool-hot-reload-maintenance branch from 27fd39a to 370f872 Compare November 29, 2026 08:38

@overtrue overtrue left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the follow-up commit 370f872eee and updated PR description:

  • ## Role Verdicts & Source Metadata: ## Role Verdicts is now present in the PR description, and crates/dialect-rustfs-admin/src/native/extensions.rs updates RUSTFS_SOURCE_COMMIT (d5ebd1a6) and evidence URLs cleanly.
  • POOLS_MAINTENANCE_STATUS Ruling & Tests (xtask/src/rustfs_admin_dialect/rulings.rs, form_tests.rs, tests.rs): POOLS_MAINTENANCE_STATUS (GET /rustfs/admin/v3/pools/maintenance/status -> MultipleActions, anyOf(admin:ServerInfo, admin:Decommission)) and the new native_pool_maintenance_status_is_any_of_server_info_and_decommission unit tests look solid, with the native dialect file count updated (20 -> 27).
  • Pending CI Verification: Multiple required CI jobs (Static checks, Clippy, Test, Workspace tests 1/3, README and API examples, etc.) failed with apt-get connection/521 errors against archive.ubuntu.com / security.ubuntu.com, so this commit has not yet passed CI. Holding approval until the failed CI workflows are re-run and green.

@loverustfs

Copy link
Copy Markdown
Contributor Author

Hi @overtrue — thanks for the review! The transient Ubuntu mirror jobs on 370f872eee have been re-run and all 34/34 CI checks (including Static checks / Role verdicts, Clippy, Workspace tests 1-3, and README and API examples) are now green.

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.

2 participants