Repository navigation
Conversation
RustFS servers serialize bucket resync start and status responses with the madmin-go `ResyncTargetsInfo` json tags (`target`, `arn`, `resetid`, `resyncStatus`, `replicationCount`, ...). The client expected PascalCase keys (`Targets`, `Arn`, `ResetID`, ...). serde matches keys case-sensitively and the target list defaulted to empty, so against a current server `resync start` reported "expected one target, got 0" after the server had accepted the run, and `resync status` always returned an empty target list. Decode the madmin-go keys and keep the PascalCase spellings as aliases for servers released before the wire change. Test fixtures now use the shape the server actually emits, with a separate test for the legacy shape.
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.
Related issue
Related to rustfs/rustfs#8768 (the
rcside of the report).Background
Since rustfs/rustfs#5799 the server encodes the replication resync start/status response with the madmin-go
ResyncTargetsInfojson tags:target,arn,resetid,startTime,endTime,resyncStatus,replicationCount,completedReplicationSize,failedReplicationCount,failedReplicationSize,bucket,object,Error,ResetBeforeDate.rcstill decoded the older PascalCase keys (Targets,Arn,ResetID, ...). serde matches keys case-sensitively and the target list is#[serde(default)], so a current server response decoded as an empty target list:rc replicate resync startfailed withexpected one target, got 0even though the server had started the resync.rc replicate resync statusalways reported no targets, so a running or stuck resync was invisible.Solution
ReplicationResyncResponseDto/ReplicationResyncTargetDtoexplicitly with the key the server sends today.defaulton the target list, because madmin omits an empty list.No CLI, JSON output, or config contract changes; only the wire decoding of the server response.
Tests
replication_resync_status_decodes_current_and_legacy_wire_shapes, which decodes both shapes, checks every converted field, checks that both decode to the same result, and checks that{}decodes to an empty list.cargo fmt --all --check,cargo clippy --workspace -- -D warnings, andcargo test --workspace(1989 passed, 0 failed) pass locally.