mirror of
https://github.com/minio/minio.git
synced 2025-11-09 05:34:56 -05:00
Allow synchronous replication if enabled. (#11165)
Synchronous replication can be enabled by setting the --sync flag while adding a remote replication target. This PR also adds proxying on GET/HEAD to another node in a active-active replication setup in the event of a 404 on the current node.
This commit is contained in:
committed by
GitHub
parent
317305d5f9
commit
7824e19d20
@@ -25,6 +25,7 @@ import (
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/minio/minio/pkg/auth"
|
||||
)
|
||||
@@ -86,34 +87,39 @@ func ParseARN(s string) (*ARN, error) {
|
||||
|
||||
// BucketTarget represents the target bucket and site association.
|
||||
type BucketTarget struct {
|
||||
SourceBucket string `json:"sourcebucket"`
|
||||
Endpoint string `json:"endpoint"`
|
||||
Credentials *auth.Credentials `json:"credentials"`
|
||||
TargetBucket string `json:"targetbucket"`
|
||||
Secure bool `json:"secure"`
|
||||
Path string `json:"path,omitempty"`
|
||||
API string `json:"api,omitempty"`
|
||||
Arn string `json:"arn,omitempty"`
|
||||
Type ServiceType `json:"type"`
|
||||
Region string `json:"omitempty"`
|
||||
Label string `json:"label,omitempty"`
|
||||
BandwidthLimit int64 `json:"bandwidthlimit,omitempty"`
|
||||
SourceBucket string `json:"sourcebucket"`
|
||||
Endpoint string `json:"endpoint"`
|
||||
Credentials *auth.Credentials `json:"credentials"`
|
||||
TargetBucket string `json:"targetbucket"`
|
||||
Secure bool `json:"secure"`
|
||||
Path string `json:"path,omitempty"`
|
||||
API string `json:"api,omitempty"`
|
||||
Arn string `json:"arn,omitempty"`
|
||||
Type ServiceType `json:"type"`
|
||||
Region string `json:"omitempty"`
|
||||
Label string `json:"label,omitempty"`
|
||||
BandwidthLimit int64 `json:"bandwidthlimit,omitempty"`
|
||||
ReplicationSync bool `json:"replicationSync"`
|
||||
HealthCheckDuration time.Duration `json:"healthCheckDuration,omitempty"`
|
||||
}
|
||||
|
||||
// Clone returns shallow clone of BucketTarget without secret key in credentials
|
||||
func (t *BucketTarget) Clone() BucketTarget {
|
||||
return BucketTarget{
|
||||
SourceBucket: t.SourceBucket,
|
||||
Endpoint: t.Endpoint,
|
||||
TargetBucket: t.TargetBucket,
|
||||
Credentials: &auth.Credentials{AccessKey: t.Credentials.AccessKey},
|
||||
Secure: t.Secure,
|
||||
Path: t.Path,
|
||||
API: t.Path,
|
||||
Arn: t.Arn,
|
||||
Type: t.Type,
|
||||
Region: t.Region,
|
||||
Label: t.Label,
|
||||
SourceBucket: t.SourceBucket,
|
||||
Endpoint: t.Endpoint,
|
||||
TargetBucket: t.TargetBucket,
|
||||
Credentials: &auth.Credentials{AccessKey: t.Credentials.AccessKey},
|
||||
Secure: t.Secure,
|
||||
Path: t.Path,
|
||||
API: t.Path,
|
||||
Arn: t.Arn,
|
||||
Type: t.Type,
|
||||
Region: t.Region,
|
||||
Label: t.Label,
|
||||
BandwidthLimit: t.BandwidthLimit,
|
||||
ReplicationSync: t.ReplicationSync,
|
||||
HealthCheckDuration: t.HealthCheckDuration,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user