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:
Klaus Post
2024-04-01 16:42:09 -07:00
committed by GitHub
parent 06929258bc
commit b435806d91
15 changed files with 366 additions and 65 deletions
+9 -2
View File
@@ -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, &params)
} 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
}