Skip to content

Commit

Permalink
UploadBlob: store blob on best volume, not 1st volume (might not be…
Browse files Browse the repository at this point in the history
… online)
  • Loading branch information
joonas-fi committed Jun 12, 2024
1 parent a45067e commit b46d5c2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions pkg/stoserver/restapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -1363,9 +1363,9 @@ func (h *handlers) UploadBlob(rctx *httpauth.RequestContext, w http.ResponseWrit
return err
}

volumeId = replicationPolicy.DesiredVolumes[0]

return nil
// save the blob first on the best volume (the one which is mounted and various other heuristics)
volumeId, err = h.conf.DiskAccess.BestVolumeId(replicationPolicy.DesiredVolumes)
return err
}); err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
Expand Down
2 changes: 1 addition & 1 deletion pkg/stoserver/stoservertypes/commands.json
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@
"title": "Change desired volumes",
"fields": [
{ "key": "Id", "hideIfDefaultValue": true },
{ "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)" },
{ "key": "Volume1", "type": "custom/integer", "optional": true, "title": "First volume", "placeholder": "Fry" },
{ "key": "Volume2", "type": "custom/integer", "optional": true, "title": "Second volume", "placeholder": "Leela" },
{ "key": "Volume3", "type": "custom/integer", "optional": true, "title": "Third volume" },
{ "key": "Volume4", "type": "custom/integer", "optional": true, "title": "Fourth volume" }
Expand Down

0 comments on commit b46d5c2

Please sign in to comment.