heal: Move CheckParts from single handler to streaming RPC (#20755)

CheckParts call can take time to verify 10k parts of a single object in a single drive.
To avoid an internal dealine of one minute in the single handler RPC, this commit will
switch to streaming RPC instead.
This commit is contained in:
Anis Eleuch
2024-12-12 06:50:57 +01:00
committed by GitHub
parent f246c9053f
commit c1a95a70ac
4 changed files with 26 additions and 15 deletions

View File

@@ -464,16 +464,20 @@ func (client *storageRESTClient) WriteAll(ctx context.Context, volume string, pa
// CheckParts - stat all file parts.
func (client *storageRESTClient) CheckParts(ctx context.Context, volume string, path string, fi FileInfo) (*CheckPartsResp, error) {
var resp *CheckPartsResp
resp, err := storageCheckPartsRPC.Call(ctx, client.gridConn, &CheckPartsHandlerParams{
st, err := storageCheckPartsRPC.Call(ctx, client.gridConn, &CheckPartsHandlerParams{
DiskID: *client.diskID.Load(),
Volume: volume,
FilePath: path,
FI: fi,
})
if err != nil {
return nil, err
return nil, toStorageErr(err)
}
return resp, nil
err = st.Results(func(r *CheckPartsResp) error {
resp = r
return nil
})
return resp, toStorageErr(err)
}
// RenameData - rename source path to destination path atomically, metadata and data file.