Skip to content

feat: allow editing the current site in site replication - #275

Open
reatang wants to merge 1 commit into
mainfrom
reatang/site-replication-local-edit
Open

reatang wants to merge 1 commit into
mainfrom
reatang/site-replication-local-edit

Conversation

@reatang

@reatang reatang commented Oct 22, 2026

Copy link
Copy Markdown
Member

Pull Request

Description

RustFS records the current site's endpoint once, when site replication is set up, from the address the setup request used. When a server's address changes (for example after an IP re-plan), every site keeps the old endpoint and replication toward that site stops, while replication from it keeps working. The Console showed "Managed automatically" on the current site's row, so the address could only be fixed from a peer site's Console or through the API. The server already accepts an edit of the local site through PUT /site-replication/edit.

This PR:

  • Offers Edit Site on the current site's row for users who can manage sites. Resync and remove stay limited to remote peers, and users without the permission still see "Managed automatically".
  • Explains in the edit dialog that the current site's endpoint is the address other sites use to reach it.
  • After a saved endpoint change, recommends the resync that recovers writes made while the old address was stale. For a moved peer the dialog offers Start Resync from this site (or only Close without the resync permission). For a moved current site it tells the operator to start a resync toward this site from each peer site's Console. Edits that do not change the endpoint show no dialog.
  • Adds the new strings to all 14 locales.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Code refactoring
  • Performance improvement
  • Test improvements
  • Security fix

Testing

  • Unit tests added/updated
  • Manual testing completed
pnpm type-check
pnpm lint
pnpm format:check
pnpm test:run   # 792 passed, 0 failed

New tests in tests/lib/site-replication-edit.test.js cover the endpoint comparison (case, whitespace, trailing slash), the "no endpoint change" case, the peer and current-site resync advice, and that the overview offers Edit Site on the current site without resync or remove.

Manual testing against a local three-site RustFS deployment built from current main:

  • Edited the current site's endpoint from its own Console: every site's stored endpoint and the peers' bucket targets changed, and the current-site resync advice appeared.
  • Edited a peer's endpoint: the peer resync advice appeared, and Start Resync sent PUT /site-replication/resync/op?operation=start (200, "Resync request started successfully").
  • Verified the remote peer menu is unchanged (Edit Site, Start/Cancel Resync, Remove Site).

Checklist

  • Code follows the project's style guidelines
  • Self-review completed
  • TypeScript types are properly defined
  • All commit messages are in English (Conventional Commits)
  • All existing tests pass
  • No new dependencies added, or they are justified

Related Issues

N/A. Found while helping an operator whose sites changed IP addresses; the matching runbook and server-side fix are in rustfs/rustfs.

Screenshots (if applicable)

Desktop, 1440x900, light theme, sidebar collapsed so the whole peer table fits.

Before: the current site's row offers no action.

Before: current site managed automatically

After: the current site's row offers Edit Site only.

After: current site menu

After: the edit dialog explains what the current site's endpoint is for.

After: current site edit dialog

After: resync advice after the current site's endpoint changes.

After: current site resync advice

After: resync advice after a peer's endpoint changes, with a direct Start Resync action.

After: peer resync advice

Additional Notes

  • The screenshots are stored on the reatang/evidence/site-replication-local-edit branch, following the existing evidence-branch convention; it can be deleted after merge.
  • The dialogs reuse the existing Dialog and useDialog components, so their mobile behavior is unchanged.
  • Local checks ran on Node 24 because Node 22 was not installed locally; CI runs the project's pinned version.

The current site's endpoint is recorded once, when site replication is set
up, from the address the setup request used. When the server's address
changes, every site keeps the old endpoint and replication toward this site
stops, but the Console only offered "Managed automatically" for the current
site, so operators had to edit it from a peer's Console or the API.

Offer Edit Site on the current site's row (resync and remove stay limited to
remote peers) and explain in the dialog that this is the address other sites
use. After a saved endpoint change, recommend the resync that recovers writes
made while the old address was stale: from this site toward a moved peer
(with a Start Resync action), or from every peer toward a moved current site.

This branch has not been deployed

No deployments
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