Skip to content

✨ S3UTILS-230 implement CRR multi-site V2 replication format#396

Open
DarkIsDude wants to merge 2 commits into
development/1from
feature/S3UTILS-230/multi-crr
Open

✨ S3UTILS-230 implement CRR multi-site V2 replication format#396
DarkIsDude wants to merge 2 commits into
development/1from
feature/S3UTILS-230/multi-crr

Conversation

@DarkIsDude
Copy link
Copy Markdown

Summary

  • Add V2 replication format support to ReplicationStatusUpdater, implementing the CRR to Multiple Sites design
  • V2 configs (rules with Filter, Priority, or Destination.Account) route through a new _markObjectPendingV2 path that writes per-backend destination/role and removes legacy top-level storageClass/storageType/destination
  • V1 configs (comma-separated StorageClass or no V2 indicators) retain existing behavior unchanged

Changes

CRR/ReplicationStatusUpdater.js

  • _isLegacyFormat() — detects V1 vs V2 bucket config format
  • _getMatchingRules() — prefix-matches object key against rules, deduplicates by site (highest priority wins)
  • _deriveRuleRole() — substitutes Destination.Account into the role ARN to produce per-rule IAM role
  • _computeTopLevelStatus() — aggregates backend statuses: FAILED > PROCESSING > COMPLETED
  • _markObjectPendingV2() — V2 metadata writer (per-backend destination/role, no legacy top-level fields)
  • _markPending() — routes to V1 or V2 path based on bucket config format

tests/utils/crr.js — V2 bucket replication config fixture

tests/unit/CRR/ReplicationStatusUpdater.js — 7 new V2 test cases (single match, dual-rule prefix overlap, no-match skip, SITE_NAME filter, all-up-to-date skip, PROCESSING aggregate status, forceUsingConfiguration)

Test plan

  • All 406 unit tests pass (yarn test:unit)
  • Lint clean (yarn lint)
  • V2 metadata written with per-backend destination/role and no legacy top-level fields
  • V1 configs produce identical output to before this change

Issue: S3UTILS-230

@DarkIsDude DarkIsDude self-assigned this May 28, 2026
@bert-e

This comment was marked as resolved.

@bert-e

This comment was marked as resolved.

Comment thread tests/unit/CRR/ReplicationStatusUpdater.js Outdated
@claude

This comment was marked as resolved.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 28, 2026

Codecov Report

❌ Patch coverage is 90.67797% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 45.65%. Comparing base (eb9592d) to head (f9fca0c).

Files with missing lines Patch % Lines
CRR/ReplicationStatusUpdater.js 90.67% 11 Missing ⚠️
Additional details and impacted files
@@                Coverage Diff                @@
##           development/1     #396      +/-   ##
=================================================
+ Coverage          44.90%   45.65%   +0.75%     
=================================================
  Files                 88       88              
  Lines               6456     6566     +110     
  Branches            1352     1378      +26     
=================================================
+ Hits                2899     2998      +99     
- Misses              3511     3522      +11     
  Partials              46       46              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread CRR/ReplicationStatusUpdater.js Outdated
Comment thread CRR/ReplicationStatusUpdater.js Outdated
Comment thread CRR/ReplicationStatusUpdater.js Outdated
Comment thread CRR/ReplicationStatusUpdater.js Outdated
Comment thread CRR/ReplicationStatusUpdater.js
@DarkIsDude DarkIsDude force-pushed the feature/S3UTILS-230/multi-crr branch from d5490b8 to f9fca0c Compare June 1, 2026 20:17
Comment thread CRR/ReplicationStatusUpdater.js
@claude

This comment was marked as resolved.

@claude

This comment was marked as resolved.

@DarkIsDude DarkIsDude requested review from a team, delthas and maeldonn June 2, 2026 14:13
@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented Jun 2, 2026

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • 2 peers

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