mirror of
https://github.com/minio/minio.git
synced 2025-11-07 21:02:58 -05:00
do not panic on rebalance during server restarts (#19563)
This PR makes a feasible approach to handle all the scenarios that we must face to avoid returning "panic." Instead, we must return "errServerNotInitialized" when a bucketMetadataSys.Get() is called, allowing the caller to retry their operation and wait. Bonus fix the way data-usage-cache stores the object. Instead of storing usage-cache.bin with the bucket as `.minio.sys/buckets`, the `buckets` must be relative to the bucket `.minio.sys` as part of the object name. Otherwise, there is no way to decommission entries at `.minio.sys/buckets` and their final erasure set positions. A bucket must never have a `/` in it. Adds code to read() from existing data-usage.bin upon upgrade.
This commit is contained in:
@@ -1833,9 +1833,18 @@ func (er erasureObjects) DeleteObject(ctx context.Context, bucket, object string
|
||||
var replcfg *replication.Config
|
||||
if opts.Expiration.Expire {
|
||||
// Check if the current bucket has a configured lifecycle policy
|
||||
lc, _ = globalLifecycleSys.Get(bucket)
|
||||
rcfg, _ = globalBucketObjectLockSys.Get(bucket)
|
||||
replcfg, _ = getReplicationConfig(ctx, bucket)
|
||||
lc, err = globalLifecycleSys.Get(bucket)
|
||||
if err != nil && !errors.Is(err, BucketLifecycleNotFound{Bucket: bucket}) {
|
||||
return objInfo, err
|
||||
}
|
||||
rcfg, err = globalBucketObjectLockSys.Get(bucket)
|
||||
if err != nil {
|
||||
return objInfo, err
|
||||
}
|
||||
replcfg, err = getReplicationConfig(ctx, bucket)
|
||||
if err != nil {
|
||||
return objInfo, err
|
||||
}
|
||||
}
|
||||
|
||||
// expiration attempted on a bucket with no lifecycle
|
||||
|
||||
Reference in New Issue
Block a user