mirror of
https://github.com/pgsty/minio.git
synced 2026-07-20 20:50:22 +03:00
Reduce big message RPC allocations (#19390)
Use `ODirectPoolSmall` buffers for inline data in PutObject. Add a separate call for inline data that will fetch a buffer for the inline data before unmarshal.
This commit is contained in:
@@ -468,7 +468,7 @@ func (client *storageRESTClient) CheckParts(ctx context.Context, volume string,
|
||||
|
||||
// RenameData - rename source path to destination path atomically, metadata and data file.
|
||||
func (client *storageRESTClient) RenameData(ctx context.Context, srcVolume, srcPath string, fi FileInfo, dstVolume, dstPath string, opts RenameOptions) (sign uint64, err error) {
|
||||
resp, err := storageRenameDataRPC.Call(ctx, client.gridConn, &RenameDataHandlerParams{
|
||||
params := RenameDataHandlerParams{
|
||||
DiskID: client.diskID,
|
||||
SrcVolume: srcVolume,
|
||||
SrcPath: srcPath,
|
||||
@@ -476,10 +476,17 @@ func (client *storageRESTClient) RenameData(ctx context.Context, srcVolume, srcP
|
||||
DstVolume: dstVolume,
|
||||
FI: fi,
|
||||
Opts: opts,
|
||||
})
|
||||
}
|
||||
var resp *RenameDataResp
|
||||
if fi.Data == nil {
|
||||
resp, err = storageRenameDataRPC.Call(ctx, client.gridConn, ¶ms)
|
||||
} else {
|
||||
resp, err = storageRenameDataInlineRPC.Call(ctx, client.gridConn, &RenameDataInlineHandlerParams{params})
|
||||
}
|
||||
if err != nil {
|
||||
return 0, toStorageErr(err)
|
||||
}
|
||||
|
||||
defer storageRenameDataRPC.PutResponse(resp)
|
||||
return resp.Signature, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user