-
Notifications
You must be signed in to change notification settings - Fork 91
add extended crrcascade tests #2460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
SylvainSenechal
wants to merge
2
commits into
improvement/ZENKO-5253/multi-crr
Choose a base branch
from
improvement/ZENKO-5311/extended-cascade-tests
base: improvement/ZENKO-5253/multi-crr
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,6 +40,46 @@ Feature: CRR Cascade Replication | |
| When I wait 15 seconds | ||
| Then the cascade replication states should be settled | ||
|
|
||
| @2.15.0 | ||
| @PreMerge | ||
| @ReplicationTest | ||
| @CRRCascade | ||
| Scenario: Cascade replication loop with non-empty object : A -> B -> C -> A | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. actually could be merged with another test and just configure 2 example : one with empty object, another with object with some data |
||
| Given cascade replication accounts are registered | ||
| And a versioned bucket exists in location "crr-location-a" | ||
| And a versioned bucket exists in location "crr-location-b" | ||
| And a versioned bucket exists in location "crr-location-c" | ||
| And replication is configured from location "crr-location-a" to "crr-location-b" | ||
| And replication is configured from location "crr-location-b" to "crr-location-c" | ||
| And replication is configured from location "crr-location-c" to "crr-location-a" | ||
| When a non-empty object "cascade-loop-nonempty-obj" is put in location "crr-location-a" | ||
| Then the object should replicate to location "crr-location-b" within 300 seconds | ||
| And the object should replicate to location "crr-location-c" within 300 seconds | ||
| And the object at location "crr-location-a" should never have replication status PENDING within 30 seconds | ||
| When I wait 15 seconds | ||
| Then the cascade replication states should be settled | ||
|
|
||
| @2.15.0 | ||
| @PreMerge | ||
| @ReplicationTest | ||
| @CRRCascade | ||
| Scenario: Cascade tag update replicates through a loop without bouncing back : A -> B -> C -> A | ||
| Given cascade replication accounts are registered | ||
| And a versioned bucket exists in location "crr-location-a" | ||
| And a versioned bucket exists in location "crr-location-b" | ||
| And a versioned bucket exists in location "crr-location-c" | ||
| And replication is configured from location "crr-location-a" to "crr-location-b" | ||
| And replication is configured from location "crr-location-b" to "crr-location-c" | ||
| And replication is configured from location "crr-location-c" to "crr-location-a" | ||
| When a non-empty object "cascade-tag-loop-obj" is put in location "crr-location-a" | ||
| Then the object should replicate to location "crr-location-b" within 300 seconds | ||
| And the object should replicate to location "crr-location-c" within 300 seconds | ||
| When tags are put on the object "cascade-tag-loop-obj" in location "crr-location-a" | ||
| Then the object at location "crr-location-c" should have the expected tags within 300 seconds | ||
| And the object at location "crr-location-a" should never have replication status PENDING within 30 seconds | ||
| When I wait 15 seconds | ||
| Then the cascade replication states should be settled | ||
|
|
||
| @2.15.0 | ||
| @PreMerge | ||
| @ReplicationTest | ||
|
|
||
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
161 changes: 151 additions & 10 deletions
161
tests/functional/ctst/features/replication/replication.feature
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,26 +1,167 @@ | ||
| Feature: Live Object Replication | ||
| This feature tests live replication of objects across different sizes, | ||
| verifying that oplog location stripping does not affect replication | ||
| correctness. | ||
|
|
||
| The objectRefreshSizeThresholdMB is set to 2 in the Zenko CR, meaning | ||
| objects >= 2 MiB have their location stripped from the MongoDB change | ||
| stream event. The replication consumer detects this and re-fetches | ||
| metadata from the source before replicating. | ||
| Feature: Bucket Replication | ||
| End-to-end coverage of Zenko's bucket replication, covering both | ||
| cloud destinations (AWS / GCP / Azure backends) and CRR loopback | ||
| destinations (replication between Zenko accounts). | ||
|
|
||
| @2.14.0 | ||
| @PreMerge | ||
| @ReplicationTest | ||
| # Targets the location-stripping threshold: objectRefreshSizeThresholdMB | ||
| # is set to 2 in the Zenko CR, so objects >= 2 MiB have their location | ||
| # stripped from the MongoDB change stream event. The replication consumer | ||
| # detects this and re-fetches metadata from the source before replicating. | ||
| Scenario Outline: Object of <objectDescription> replicates with location stripping threshold | ||
| Given an existing bucket "repl-strip-<sizeBytes>" "with" versioning, "without" ObjectLock "without" retention mode | ||
| And a replication configuration to "awsbackendmismatch" location | ||
| And 1 objects "repl-strip-obj" of size <sizeBytes> bytes | ||
| Then the object replication should "succeed" within 300 seconds | ||
| And the replicated object should be the same as the source object | ||
| And the replicated object should match the source on every configured destination | ||
|
|
||
| Examples: | ||
| | sizeBytes | objectDescription | | ||
| | 0 | 0 bytes (zero-byte) | | ||
| | 1048576 | 1 MiB (below threshold) | | ||
| | 2097152 | 2 MiB (at threshold, stripped) | | ||
| | 4194304 | 4 MiB (above threshold, stripped) | | ||
|
|
||
| @2.15.0 | ||
| @PreMerge | ||
| @ReplicationTest | ||
| # Multi-destination replication: a single replication configuration | ||
| # carries several rules targeting distinct destinations, optionally with | ||
| # overlapping prefixes resolved by Priority. The legacy V1 format and | ||
| # the non-standard comma-separated StorageClass form remain supported | ||
| # for backward compatibility and round-trip unchanged through | ||
| # getBucketReplication. | ||
| Scenario: V2 replication fans out to two cloud destinations | ||
| Given an existing bucket "multi-cloud-2" "with" versioning, "without" ObjectLock "without" retention mode | ||
| And a valid multi-destination replication configuration with rules: | ||
| | id | prefix | priority | location | | ||
| | rule-a | | 1 | awsbackendmismatch | | ||
| | rule-b | | 2 | awsbackend | | ||
| And 1 objects "multi-cloud-obj" of size 1024 bytes | ||
| Then the object replication should "succeed" within 300 seconds | ||
| And the replicated object should match the source on every configured destination | ||
|
|
||
| @2.15.0 | ||
| @PreMerge | ||
| @ReplicationTest | ||
| Scenario: V2 replication fans out to three cloud destinations | ||
| Given an existing bucket "multi-cloud-3" "with" versioning, "without" ObjectLock "without" retention mode | ||
| And a valid multi-destination replication configuration with rules: | ||
| | id | prefix | priority | location | | ||
| | rule-a | | 1 | awsbackendmismatch | | ||
| | rule-b | | 2 | gcpbackendmismatch | | ||
| | rule-c | | 3 | azurebackendmismatch | | ||
| And 1 objects "multi-cloud-obj" of size 1024 bytes | ||
| Then the object replication should "succeed" within 300 seconds | ||
| And the replicated object should match the source on every configured destination | ||
|
|
||
| @2.15.0 | ||
| @PreMerge | ||
| @ReplicationTest | ||
| Scenario: CRR + cloud mixed destination replication | ||
| Given cascade replication accounts are registered | ||
| And a versioned bucket exists in location "crr-location-a" | ||
| And an existing bucket "multi-mixed" "with" versioning, "without" ObjectLock "without" retention mode | ||
| And a valid multi-destination replication configuration with rules: | ||
| | id | prefix | priority | location | | ||
| | rule-c | | 1 | crr-location-a | | ||
| | rule-x | | 2 | awsbackendmismatch | | ||
| And 1 objects "mixed-obj" of size 1024 bytes | ||
| Then the object replication should "succeed" within 300 seconds | ||
| And the replicated object should match the source on every configured destination | ||
|
|
||
| @2.15.0 | ||
| @PreMerge | ||
| @ReplicationTest | ||
| Scenario: V2 rules with overlapping prefixes to different destinations all apply | ||
| Given an existing bucket "multi-overlap" "with" versioning, "without" ObjectLock "without" retention mode | ||
| And a valid multi-destination replication configuration with rules: | ||
| | id | prefix | priority | location | | ||
| | broad | | 1 | awsbackendmismatch | | ||
| | narrow | docs- | 2 | awsbackend | | ||
| And 1 objects "docs-report" of size 1024 bytes | ||
| Then the object replication should "succeed" within 300 seconds | ||
| And the replicated object should match the source on every configured destination | ||
|
|
||
| @2.15.0 | ||
| @PreMerge | ||
| @ReplicationTest | ||
| Scenario: Disabled rule does not replicate | ||
| Given an existing bucket "multi-disabled" "with" versioning, "without" ObjectLock "without" retention mode | ||
| And a valid multi-destination replication configuration with rules: | ||
| | id | prefix | priority | status | location | | ||
| | active | | 1 | Enabled | awsbackendmismatch | | ||
| | off | | 2 | Disabled | awsbackend | | ||
| And 1 objects "disabled-obj" of size 1024 bytes | ||
| Then the object replication should "succeed" within 300 seconds | ||
| And the object should not be replicated to "awsbackend" | ||
| And the replicated object on "awsbackendmismatch" should match the source | ||
|
|
||
| @2.15.0 | ||
| @PreMerge | ||
| @ReplicationTest | ||
| Scenario: Overlap on same destination without distinct priorities is rejected | ||
| Given an existing bucket "multi-bad-overlap" "with" versioning, "without" ObjectLock "without" retention mode | ||
| And an invalid multi-destination replication configuration with rules: | ||
| | id | prefix | priority | location | | ||
| | dup-a | | 1 | awsbackendmismatch | | ||
| | dup-b | docs-| 1 | awsbackendmismatch | | ||
| Then the replication configuration request should be rejected with "InvalidRequest" | ||
|
|
||
| @2.15.0 | ||
| @PreMerge | ||
| @ReplicationTest | ||
| Scenario: Same destination overlap with distinct priorities is accepted | ||
| Given an existing bucket "multi-priority-dedup" "with" versioning, "without" ObjectLock "without" retention mode | ||
| And a valid multi-destination replication configuration with rules: | ||
| | id | prefix | priority | location | | ||
| | lo | | 1 | awsbackendmismatch | | ||
| | hi | docs-| 2 | awsbackendmismatch | | ||
| And 1 objects "docs-winner" of size 1024 bytes | ||
| Then the object replication should "succeed" within 300 seconds | ||
| And the replicated object on "awsbackendmismatch" should match the source | ||
|
|
||
| @2.15.0 | ||
| @PreMerge | ||
| @ReplicationTest | ||
| Scenario: V1 configuration replicates and round-trips through getBucketReplication | ||
| Given an existing bucket "multi-v1-compat" "with" versioning, "without" ObjectLock "without" retention mode | ||
| And a valid multi-destination replication configuration with rules: | ||
| | id | prefix | location | | ||
| | v1-only | | awsbackendmismatch | | ||
| And 1 objects "v1-obj" of size 1024 bytes | ||
| Then the object replication should "succeed" within 300 seconds | ||
| And the replicated object on "awsbackendmismatch" should match the source | ||
| And getBucketReplication should return a "V1" configuration with 1 rules | ||
|
|
||
| @2.15.0 | ||
| @PreMerge | ||
| @ReplicationTest | ||
| Scenario: Legacy comma-separated StorageClass replicates to multiple sites | ||
| Given an existing bucket "multi-legacy-comma" "with" versioning, "without" ObjectLock "without" retention mode | ||
| And a legacy comma-StorageClass replication configuration to locations "awsbackendmismatch,awsbackend" | ||
| And 1 objects "legacy-obj" of size 1024 bytes | ||
| Then the object replication should "succeed" within 300 seconds | ||
| And the replicated object should match the source on every configured destination | ||
| And getBucketReplication should return a "V1" configuration with 1 rules | ||
| And getBucketReplication rule 0 should have StorageClass "awsbackendmismatch,awsbackend" | ||
|
|
||
| @2.15.0 | ||
| @PreMerge | ||
| @ReplicationTest | ||
| @MultiCRR | ||
| Scenario: Two CRR destinations replicate independently | ||
| Given cascade replication accounts are registered | ||
| And a versioned bucket exists in location "crr-location-a" | ||
| And a versioned bucket exists in location "crr-location-b" | ||
| And an existing bucket "multi-crr-pair" "with" versioning, "without" ObjectLock "without" retention mode | ||
| And a valid multi-destination replication configuration with rules: | ||
| | id | prefix | priority | location | | ||
| | crr-a | | 1 | crr-location-a | | ||
| | crr-b | | 2 | crr-location-b | | ||
| And 1 objects "crr-pair-obj" of size 1024 bytes | ||
| Then the object replication should "succeed" within 300 seconds | ||
| And the replicated object on "crr-location-a" should match the source | ||
| And the replicated object on "crr-location-b" should match the source |
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All those new tests should be marked 2.16 since that's where CRR will land.