From 7c696e1cb6f1ebe9973eb77c17af2f3bcc63e54f Mon Sep 17 00:00:00 2001 From: Shireesh Anjal <355479+anjalshireesh@users.noreply.github.com> Date: Mon, 4 Apr 2022 01:45:02 +0530 Subject: [PATCH] Write deployment id to health report at the start (#14673) The deployment id was being written to the health report towards the end of the handler. Because of this, if there was a timeout in any of the data fetching, the deployment id was not getting written at all. Upload of such reports fails on SUBNET as deployment id is the unique identifier for a cluster in subnet. Fixed by writing the deployment id at the beginning of the processing. --- cmd/admin-handlers.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/cmd/admin-handlers.go b/cmd/admin-handlers.go index 2abe2a6c0..4d8778809 100644 --- a/cmd/admin-handlers.go +++ b/cmd/admin-handlers.go @@ -1663,7 +1663,14 @@ func (a adminAPIHandlers) HealthInfoHandler(w http.ResponseWriter, r *http.Reque } query := r.Form - healthInfo := madmin.HealthInfo{Version: madmin.HealthInfoVersion} + healthInfo := madmin.HealthInfo{ + Version: madmin.HealthInfoVersion, + Minio: madmin.MinioHealthInfo{ + Info: madmin.MinioInfo{ + DeploymentID: globalDeploymentID, + }, + }, + } healthInfoCh := make(chan madmin.HealthInfo) enc := json.NewEncoder(w) @@ -1999,7 +2006,7 @@ func (a adminAPIHandlers) HealthInfoHandler(w http.ResponseWriter, r *http.Reque go func() { defer close(healthInfoCh) - partialWrite(healthInfo) // Write first message with only version populated + partialWrite(healthInfo) // Write first message with only version and deployment id populated getAndWriteCPUs() getAndWritePartitions() getAndWriteOSInfo()