mirror of
https://github.com/minio/minio.git
synced 2025-11-21 02:09:08 -05:00
fix: various optimizations, idiomatic changes (#9179)
- acquire since leader lock for all background operations - healing, crawling and applying lifecycle policies. - simplify lifecyle to avoid network calls, which was a bug in implementation - we should hold a leader and do everything from there, we have access to entire name space. - make listing, walking not interfere by slowing itself down like the crawler. - effectively use global context everywhere to ensure proper shutdown, in cache, lifecycle, healing - don't read `format.json` for prometheus metrics in StorageInfo() call.
This commit is contained in:
@@ -614,32 +614,6 @@ func (client *peerRESTClient) BackgroundHealStatus() (madmin.BgHealState, error)
|
||||
return state, err
|
||||
}
|
||||
|
||||
// BgLifecycleOpsStatus describes the status
|
||||
// of the background lifecycle operations
|
||||
type BgLifecycleOpsStatus struct {
|
||||
LastActivity time.Time
|
||||
}
|
||||
|
||||
// BgOpsStatus describes the status of all operations performed
|
||||
// in background such as auto-healing and lifecycle.
|
||||
// Notice: We need to increase peer REST API version when adding
|
||||
// new fields to this struct.
|
||||
type BgOpsStatus struct {
|
||||
LifecycleOps BgLifecycleOpsStatus
|
||||
}
|
||||
|
||||
func (client *peerRESTClient) BackgroundOpsStatus() (BgOpsStatus, error) {
|
||||
respBody, err := client.call(peerRESTMethodBackgroundOpsStatus, nil, nil, -1)
|
||||
if err != nil {
|
||||
return BgOpsStatus{}, err
|
||||
}
|
||||
defer http.DrainBody(respBody)
|
||||
|
||||
state := BgOpsStatus{}
|
||||
err = gob.NewDecoder(respBody).Decode(&state)
|
||||
return state, err
|
||||
}
|
||||
|
||||
func (client *peerRESTClient) doTrace(traceCh chan interface{}, doneCh chan struct{}, trcAll, trcErr bool) {
|
||||
values := make(url.Values)
|
||||
values.Set(peerRESTTraceAll, strconv.FormatBool(trcAll))
|
||||
|
||||
Reference in New Issue
Block a user