From 8df6112204353d23fcaf3a598b7df7a5b6486f34 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Mon, 9 Nov 2020 20:40:39 -0800 Subject: [PATCH] fix: avoid divide by zero error single node distributed setup (#10862) --- cmd/bucket-replication.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/bucket-replication.go b/cmd/bucket-replication.go index 045d9de99..021b48d80 100644 --- a/cmd/bucket-replication.go +++ b/cmd/bucket-replication.go @@ -237,6 +237,9 @@ func replicateObject(ctx context.Context, objInfo ObjectInfo, objectAPI ObjectLa // Setup bandwidth throttling peers, _ := globalEndpoints.peers() totalNodesCount := len(peers) + if totalNodesCount == 0 { + totalNodesCount = 1 // For standalone erasure coding + } b := target.BandwidthLimit / int64(totalNodesCount) var headerSize int for k, v := range putOpts.Header() {