mirror of
https://github.com/minio/minio.git
synced 2025-11-21 10:16:03 -05:00
fix: site replication bucket heal to not panic if replication config is missing (#15025)
This commit is contained in:
@@ -3991,14 +3991,21 @@ func (c *SiteReplicationSys) healBucketReplicationConfig(ctx context.Context, ob
|
|||||||
}
|
}
|
||||||
rcfg, _, err := globalBucketMetadataSys.GetReplicationConfig(ctx, bucket)
|
rcfg, _, err := globalBucketMetadataSys.GetReplicationConfig(ctx, bucket)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
_, ok := err.(BucketReplicationConfigNotFound)
|
||||||
|
if !ok {
|
||||||
|
return err
|
||||||
|
}
|
||||||
replMismatch = true
|
replMismatch = true
|
||||||
}
|
}
|
||||||
|
|
||||||
// validate remote targets on current cluster for this bucket
|
if rcfg != nil {
|
||||||
_, apiErr := validateReplicationDestination(ctx, bucket, rcfg, false)
|
// validate remote targets on current cluster for this bucket
|
||||||
if apiErr != noError {
|
_, apiErr := validateReplicationDestination(ctx, bucket, rcfg, false)
|
||||||
replMismatch = true
|
if apiErr != noError {
|
||||||
|
replMismatch = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if replMismatch {
|
if replMismatch {
|
||||||
err := c.PeerBucketConfigureReplHandler(ctx, bucket)
|
err := c.PeerBucketConfigureReplHandler(ctx, bucket)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user