Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix timeouts in RepairStatus and LoadSSTables #3673

Merged
merged 3 commits into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion pkg/scyllaclient/client_scylla.go
Original file line number Diff line number Diff line change
Expand Up @@ -513,9 +513,12 @@ func repairStatusShouldRetryHandler(err error) *bool {
return nil
}

const repairStatusTimeout = 30 * time.Minute

// RepairStatus waits for repair job to finish and returns its status.
func (c *Client) RepairStatus(ctx context.Context, host string, id int32) (CommandStatus, error) {
ctx = forceHost(ctx, host)
ctx = customTimeout(ctx, repairStatusTimeout)
ctx = withShouldRetryHandler(ctx, repairStatusShouldRetryHandler)
var (
resp interface {
Expand Down Expand Up @@ -896,6 +899,8 @@ func (c *Client) TableDiskSizeReport(ctx context.Context, hostKeyspaceTables Hos
return report, err
}

const loadSSTablesTimeout = time.Hour

// LoadSSTables that are already downloaded to host's table upload directory.
// Used API endpoint has the following properties:
// - It is synchronous - response is received only after the loading has finished
Expand All @@ -906,7 +911,7 @@ func (c *Client) LoadSSTables(ctx context.Context, host, keyspace, table string,
const WIPError = "Already loading SSTables"

_, err := c.scyllaOps.StorageServiceSstablesByKeyspacePost(&operations.StorageServiceSstablesByKeyspacePostParams{
Context: forceHost(ctx, host),
Context: customTimeout(forceHost(ctx, host), loadSSTablesTimeout),
Keyspace: keyspace,
Cf: table,
LoadAndStream: &loadAndStream,
Expand Down
2 changes: 1 addition & 1 deletion pkg/service/repair/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func (w *worker) runRepair(ctx context.Context, j job) (out error) {
)
// Decorate returned error
defer func() {
w.logger.Info(ctx, "Repair done")
w.logger.Info(ctx, "Repair done", "job_id", jobID)
// Try to justify error by checking table deletion
if out != nil && w.isTableDeleted(ctx, j) {
out = errTableDeleted
Expand Down