Repository navigation
Conversation
The bucket replication rule editor showed "Replicate Delete" off for rules the server reports as Enabled, and showed the default 60 s health check and 100 GiB/s bandwidth for a remote target stored with 0/0. GetBucketReplication goes through @aws-sdk/client-s3, whose schema-driven deserializer drops the MinIO/RustFS <DeleteReplication> extension, so the parsed rules never carried it; the console only patched the element into PutBucketReplication bodies. Every re-PUT of fetched rules therefore also silently disabled delete replication. Move the PUT patch into lib/bucket-replication-delete and add the GET side: buffer the response XML below the deserializer and merge each rule's status into the parsed output. list-remote-targets encodes targets with madmin's JSON tags: the limit is `bandwidthlimit` (the console read `bandwidth_limit`, so every target showed the default) and `healthCheckDuration` is Go nanoseconds. Read both through lib/bucket-replication-target, keep a stored 0 as 0 instead of falling back to the form defaults, and let a 0 interval pass validation so such a target stays saveable.
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
The bucket replication rule editor misreported two stored values:
GetBucketReplicationreturns<DeleteReplication><Status>Enabled</Status></DeleteReplication>. The console reads the configuration through@aws-sdk/client-s3, whose schema-driven deserializer drops the MinIO/RustFS<DeleteReplication>extension, so parsed rules never carried the field. The console only patched the element intoPutBucketReplicationbodies (contexts/s3-context.tsx), never on the read side. As a consequence every save that re-PUTs the fetched rules also silently rewrote delete replication asDisabled.list-remote-targetsencodes targets with madmin's JSON tags: the limit isbandwidthlimit(the form readbandwidth_limit, so every target showed the default regardless of the stored value) andhealthCheckDurationis a Gotime.Durationin nanoseconds. The form also folded a stored 0 into the defaults with|| 60and!bytes.Changes:
lib/bucket-replication-delete.ts: moves the existing PUT-side patch out ofcontexts/s3-context.tsxand adds the GET side. A middleware below the SDK deserializer buffers theGetBucketReplicationXML and hands it (keyed by request) to a middleware above the deserializer, which merges each rule'sDeleteReplicationstatus into the parsed output. The hand-over is needed because the S3 client's ownthrow200ExceptionsMiddlewaresits between the two and re-wraps the body as a fresh stream.lib/bucket-replication-target.ts: readsbandwidthlimit(falling back to the legacybandwidth_limit), convertshealthCheckDurationfrom nanoseconds using the same threshold the server uses for seconds-or-nanos input, and keeps a stored 0 distinct from an unreported field.components/replication/edit-form.tsx: initialises the form and the bandwidth change detection through those helpers, accepts a 0 interval in validation and the input'sminso a target stored with 0 stays saveable, and sends the displayed interval instead of coercing 0 back to 60.Type of Change
Testing
All four pass (864 tests). New suites:
tests/lib/bucket-replication-delete.test.ts(XML status extraction, merge, PUT injection, and the GET middleware pair run around a fake deserializer that re-wraps the body like the SDK does) andtests/lib/bucket-replication-target.test.ts(nanosecond and legacy second intervals, both bandwidth keys, 0 versus unreported).Manual: two local single-disk RustFS instances (source with
RUSTFS_REPLICATION_ALLOW_LOOPBACK_TARGET=true), a remote target created throughset-remote-targetwithhealthCheckDuration: 0andbandwidth: 0, and a rule PUT withDeleteReplication,DeleteMarkerReplicationandExistingObjectReplicationallEnabled.list-remote-targetsreturned"bandwidthlimit":0,"healthCheckDuration":0. The GET middleware was also exercised with the real SDK from Node against that server. Saving the rule unchanged from the editor returns "Update Success" and the server still reportsDeleteReplicationEnabledand the target 0/0.Checklist
Related Issues
Fixes rustfs/rustfs#9068 (the Console part). The server side of that issue, the missing
s3:ForceDeleteObjectpermission for the site replicator, is handled by rustfs/rustfs#9069; this PR only fixes what the editor displays and writes back.Screenshots (if applicable)
No screenshots. Values of the edit dialog for the same rule and target, read from the DOM in the dev console:
Additional Notes
set-remote-target?update=truerejects thehealthcheckupdate op on current servers, so the health check interval shown in the edit dialog is display-only on update until the server supports that op; this PR does not change which ops are sent. The dialog still shows the stored interval rather than a default.