Skip to content

Commit b46d5c2

Browse files
committed
UploadBlob: store blob on best volume, not 1st volume (might not be online)
1 parent a45067e commit b46d5c2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pkg/stoserver/restapi.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1363,9 +1363,9 @@ func (h *handlers) UploadBlob(rctx *httpauth.RequestContext, w http.ResponseWrit
13631363
return err
13641364
}
13651365

1366-
volumeId = replicationPolicy.DesiredVolumes[0]
1367-
1368-
return nil
1366+
// save the blob first on the best volume (the one which is mounted and various other heuristics)
1367+
volumeId, err = h.conf.DiskAccess.BestVolumeId(replicationPolicy.DesiredVolumes)
1368+
return err
13691369
}); err != nil {
13701370
http.Error(w, err.Error(), http.StatusInternalServerError)
13711371
return

pkg/stoserver/stoservertypes/commands.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@
593593
"title": "Change desired volumes",
594594
"fields": [
595595
{ "key": "Id", "hideIfDefaultValue": true },
596-
{ "key": "Volume1", "type": "custom/integer", "optional": true, "title": "First volume", "placeholder": "Fry", "help": "First volume is special - it's where the synchronous part of the replica is placed first (before the asynchronous replication kicks off)" },
596+
{ "key": "Volume1", "type": "custom/integer", "optional": true, "title": "First volume", "placeholder": "Fry" },
597597
{ "key": "Volume2", "type": "custom/integer", "optional": true, "title": "Second volume", "placeholder": "Leela" },
598598
{ "key": "Volume3", "type": "custom/integer", "optional": true, "title": "Third volume" },
599599
{ "key": "Volume4", "type": "custom/integer", "optional": true, "title": "Fourth volume" }

0 commit comments

Comments
 (0)