Skip to content
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

Add support for multi destination replication #12880

Merged
merged 1 commit into from
Sep 18, 2021

Conversation

poornas
Copy link
Contributor

@poornas poornas commented Aug 5, 2021

Description

Motivation and Context

AWS supports replicating to multiple destination buckets - this PR adds equivalent functionality for MinIO
Needs companion mc PR minio/mc#3766

How to test this PR?

With the mc PR referenced above, and the replication docs.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Optimization (provides speedup with no functional changes)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • Fixes a regression (If yes, please add commit-id or PR # here)
  • Documentation updated
  • Unit tests added/updated

@klauspost
Copy link
Contributor

@poornas Is there a madmin-go PR as well, or is it already merged?

@poornas
Copy link
Contributor Author

poornas commented Sep 1, 2021

@poornas Is there a madmin-go PR as well, or is it already merged?

minio/madmin-go@e6d765f - PR was merged but I can't remove the local dependency reference because the minio speedtest autotune PR needs to be merged first - madmin.Speedtestresult structure has changed and those need to be applied before this PR will compile. madmin v1.1.1 with the commit above is needed for this PR to compile for now.

Copy link
Contributor

@klauspost klauspost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor stuff/questions.

cmd/bucket-stats.go Show resolved Hide resolved
cmd/bucket-stats.go Outdated Show resolved Hide resolved
cmd/bucket-stats.go Show resolved Hide resolved
cmd/bucket-stats.go Show resolved Hide resolved
cmd/data-usage-cache.go Show resolved Hide resolved
cmd/storage-datatypes.go Show resolved Hide resolved
@klauspost
Copy link
Contributor

Let's make this build. See if you can push for the upstream changes you need.

@poornas poornas force-pushed the multisite branch 3 times, most recently from 4499711 to 97ab82b Compare September 9, 2021 03:05
@vadmeste
Copy link
Member

vadmeste commented Sep 9, 2021

@poornas I tested today and I found two issues:

  • Modtime of delete marker in the target site is not correct
  • When uploading to three sites at the same time, the three sites won't sync and there is these logs:
vadmeste@fastdebian:~/work/go/gospace/code/replication$                                            
API: SYSTEM()
Time: 20:47:08 CET 09/09/2021
DeploymentID: 785dcbbf-5ef6-40a2-99b6-01c7c71a86e1
Error: Unable to replicate for object testbucket/dir/file(1df00c0d-af44-44bb-9d2e-25d9ce89caca): Put "http://localhost:9002/testbucket/dir/file?versionId=1df00c0d-af44-44bb-9d2e-25d9ce89caca": context canceled (*errors.errorString)                                                                                                                                                                       
       2: /home/vadmeste/work/go/gospace/code/minio/cmd/bucket-replication.go:1094:cmd.replicateObjectToTarget()     
       1: /home/vadmeste/work/go/gospace/code/minio/cmd/bucket-replication.go:859:cmd.replicateObject.func2()                                                                                          
                                                 
API: SYSTEM()                
Time: 20:47:08 CET 09/09/2021                                                                      
DeploymentID: 785dcbbf-5ef6-40a2-99b6-01c7c71a86e1                                         
Error: failed to get lock for object: dir/file bucket:testbucket arn: (*errors.errorString)                                                                                                            
       2: /home/vadmeste/work/go/gospace/code/minio/cmd/bucket-replication.go:835:cmd.replicateObject()              
       1: /home/vadmeste/work/go/gospace/code/minio/cmd/bucket-replication.go:1281:cmd.(*ReplicationPool).AddWorker()                                                                                  
               

@poornas
Copy link
Contributor Author

poornas commented Sep 9, 2021

@poornas I tested today and I found two issues:

  • Modtime of delete marker in the target site is not correct
  • When uploading to three sites at the same time, the three sites won't sync and there is these logs:

I haven't been able to repro this yet - will ping you on the test scenario

@poornas poornas force-pushed the multisite branch 2 times, most recently from 346faf6 to 2fa9304 Compare September 9, 2021 22:37
@vadmeste
Copy link
Member

@poornas to reproduce modtime issue, you need to take a look directly at xl.meta using xl-meta tool. You don't see it because the modtime of the delete marker in the source & target site are very close, at the same second most of the time.

Also I checked, it works fine with master

@poornas
Copy link
Contributor Author

poornas commented Sep 10, 2021

@poornas to reproduce modtime issue, you need to take a look directly at xl.meta using xl-meta tool. You don't see it because the modtime of the delete marker in the source & target site are very close, at the same second most of the time.

Also I checked, it works fine with master

fixed this

cmd/admin-bucket-handlers.go Outdated Show resolved Hide resolved
cmd/api-headers.go Outdated Show resolved Hide resolved
cmd/bucket-handlers.go Show resolved Hide resolved
cmd/bucket-handlers.go Outdated Show resolved Hide resolved
cmd/bucket-targets.go Outdated Show resolved Hide resolved
cmd/bucket-targets.go Outdated Show resolved Hide resolved
cmd/erasure-metadata.go Show resolved Hide resolved
go.mod Outdated Show resolved Hide resolved
@poornas poornas force-pushed the multisite branch 2 times, most recently from 9a77da2 to 5f3a621 Compare September 13, 2021 20:36
@minio minio deleted a comment from minio-trusted Sep 13, 2021
cmd/api-datatypes.go Show resolved Hide resolved
cmd/api-datatypes.go Show resolved Hide resolved
cmd/bucket-handlers.go Show resolved Hide resolved
cmd/bucket-handlers.go Outdated Show resolved Hide resolved
cmd/erasure.go Outdated Show resolved Hide resolved
@harshavardhana
Copy link
Member

Can you resolve the conflicts on the PR ? @poornas

@harshavardhana
Copy link
Member

@poornas

cmd/data-usage_test.go:589:5: unknown field `ReplicaSize` in struct literal (typecheck)
				ReplicaSize:    4,

@poornas poornas force-pushed the multisite branch 2 times, most recently from 6cb4809 to 14cf5a0 Compare September 17, 2021 21:38
@minio-trusted
Copy link
Contributor

Mint Automation

Test Result
mint-large-bucket.sh ✔️
mint-fs.sh ✔️
mint-gateway-s3.sh ✔️
mint-erasure.sh ✔️
mint-dist-erasure.sh ✔️
mint-zoned.sh ✔️
mint-gateway-nas.sh ✔️
mint-compress-encrypt-dist-erasure.sh ✔️
Deleting image on docker hub
Deleting image locally

@harshavardhana harshavardhana merged commit c4373ef into minio:master Sep 18, 2021
@harshavardhana harshavardhana deleted the multisite branch September 18, 2021 20:31
@poornas poornas mentioned this pull request Oct 21, 2021
7 tasks
poornas pushed a commit to poornas/minio that referenced this pull request Jan 18, 2022
When replication rule is based on tag matches, replication process
should pick up targets matching the tags specified in the replication
rule.

Fixing regression due to minio#12880
harshavardhana pushed a commit that referenced this pull request Jan 19, 2022
When the replication rule is based on tag matches, the replication process
should pick up targets matching the tags specified in the replication
rule.

Fixing regression due to #12880
poornas pushed a commit to poornas/minio that referenced this pull request May 24, 2022
poornas pushed a commit to poornas/minio that referenced this pull request May 24, 2022
poornas pushed a commit to poornas/minio that referenced this pull request May 25, 2022
poornas pushed a commit to poornas/minio that referenced this pull request May 25, 2022
harshavardhana pushed a commit that referenced this pull request May 25, 2022
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.

None yet

5 participants