Repository navigation
Conversation
Operators could not tell from the Site Replication page whether replication was working. The server already reports peer reachability, failures, queue depth, undelivered configuration changes, unfinished lifecycle operations, and configuration drift, but the page only rendered configuration fields, and three of them read like health signals while carrying none: - the black "Enabled" sync badge is the per-peer sync setting, not link health, and stays "Enabled" while the peer is down; - "Replicated Objects/Size" are in-memory counters of the node that answered the request, reset on restart and not limited to site replication targets; - "Last Online" was taken from the local entry and always read "now". Add a health summary (healthy / needs attention / unhealthy / unknown) with the reasons behind it, a per-peer connection column with last-online time and downtime, a failures and backlog section, a consistency list of buckets, IAM entities, and expiry rules that differ between sites, an on-demand resync status view, and a 30-second quiet auto refresh while the tab is visible. Drop the misleading summary fields and render the sync setting as plain text. Health is derived in lib/site-replication-health.ts so the rules are unit tested: an unreachable peer is critical and suppresses the drift comparison (it reports empty metadata), and peers without a metric entry on servers older than rustfs/rustfs#7024 stay "unknown" instead of reading healthy. Resync status is fetched on demand only, because the server takes the lifecycle lock and persists state on every status call. The duplicated duration formatter moves from the status page to lib/functions.ts so both pages share it. Refs rustfs/backlog#2922
reatang
marked this pull request as draft
October 23, 2026 13:36
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Description
Operators could not tell from the Site Replication page whether replication was actually working. The server already reports peer reachability, object replication failures, queue depth, undelivered configuration changes, unfinished lifecycle operations, and configuration drift between sites, but the page only rendered configuration fields. Worse, three fields read like health signals while carrying none:
This PR is the P0 (console-only) part of rustfs/backlog#2922. All data comes from endpoints the page already calls (
site-replication/infoandsite-replication/status); no server change is needed.Implementation notes:
lib/site-replication-health.tsas pure functions so they are unit tested independently of the page. Peers without a metric entry (servers before fix(admin): report real peer health in site replication status rustfs#7024 only report the local entry) stay Unknown instead of reading as healthy.hooks/use-site-replication.tsnow normalizesPeerErrors,PendingOperation,RetryStats,BucketStats,PolicyStats,UserStats,GroupStats,ILMExpiryStats, metricfailedwindows, andqueued, plus the resync status counters.lib/functions.tsso both pages share it.Type of Change
Testing
tests/lib/site-replication-health.test.ts(11 cases): healthy group; offline peer via metric and via peer error (critical, keeps last-online time and downtime); unreachable peer suppresses the drift comparison; peers without a metric entry stay unknown; pending operation, retry backlog, and last-hour failures degrade health while an empty retry queue and older failures do not; drift lists missing and mismatched buckets, policies, and users; info-only fallback when the status endpoint is unavailable; local site counts as online without its own metric entry.tests/lib/functions.test.tscovers the sharedformatDuration.pnpm test:run(799 pass),pnpm type-check,pnpm lint,pnpm format:check, andpnpm install --frozen-lockfileall pass.rustfsmain (scripts/test/site_replication_smoke.py):Checklist
Related Issues
Refs rustfs/backlog#2922 (P0 only; the backend data items in P1 and the alerting guide in P2 remain open)
Screenshots (if applicable)
All screenshots are from the same local two-site lab, before (current
main) and after this PR.Both sites healthy
Site B stopped. Before: the page looks exactly like the healthy state; Sync still says "Enabled" and Last Online shows the current time. After: Unhealthy with reasons, and site B is Offline with its last-online time.
Site B back, queued changes not yet delivered (after only)
Mobile (after)
Additional Notes
uptimevalue. Peer error strings are currently the server's debug-formattedS3Error, which is why the page clamps them.Replicated ObjectsandReplicated Sizelocale keys are no longer used by this page but are left in place to avoid churning existing keys.reatang/evidence/site-replication-healthbranch and are referenced by commit SHA.