From 641a56da0d7fe7e86792f1108c50ceeca78fc31d Mon Sep 17 00:00:00 2001 From: Poorna Date: Fri, 26 Jul 2024 13:48:21 -0700 Subject: [PATCH] fix panic in replication queuing (#20169) Regression from #20077 ``` Jul 26 19:08:29 minio-dr-0101a minio[275423]: Error: grid handler (NSScanner) panic: runtime error: index out of range [4] with length 1 (*errors.errorString) Jul 26 19:08:29 minio-dr-0101a minio[275423]: 33: internal/logger/logger.go:268:logger.LogIf() Jul 26 19:08:29 minio-dr-0101a minio[275423]: 32: internal/grid/connection.go:50:grid.gridLogIf() Jul 26 19:08:29 minio-dr-0101a minio[275423]: 31: internal/grid/muxserver.go:234:grid.(*muxServer).handleRequests.func1() Jul 26 19:08:29 minio-dr-0101a minio[275423]: 30: cmd/bucket-replication.go:2165:cmd.(*ReplicationPool).queueReplicaTask() Jul 26 19:08:29 minio-dr-0101a minio[275423]: 29: cmd/bucket-replication.go:3440:cmd.queueReplicationHeal() Jul 26 19:08:29 minio-dr-0101a minio[275423]: 28: cmd/data-scanner.go:1396:cmd.(*scannerItem).healReplication() Jul 26 19:08:29 minio-dr-0101a minio[275423]: 27: cmd/data-scanner.go:1220:cmd.(*scannerItem).applyActions() Jul 26 19:08:29 minio-dr-0101a minio[275423]: 26: cmd/xl-storage.go:627:cmd.(*xlStorage).NSScanner.func2() ``` --- cmd/bucket-replication.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/bucket-replication.go b/cmd/bucket-replication.go index 91566c6a2..fecf8c9e7 100644 --- a/cmd/bucket-replication.go +++ b/cmd/bucket-replication.go @@ -2171,7 +2171,7 @@ func (p *ReplicationPool) queueReplicaTask(ri ReplicateObjectInfo) { h := xxh3.HashString(ri.Bucket + ri.Name) select { case <-p.ctx.Done(): - case p.lrgworkers[h%LargeWorkerCount] <- ri: + case p.lrgworkers[h%uint64(len(p.lrgworkers))] <- ri: default: globalReplicationPool.queueMRFSave(ri.ToMRFEntry()) p.mu.RLock()