-
Notifications
You must be signed in to change notification settings - Fork 301
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(warehouse): infinites retries #3050
Conversation
… of retries and retry duration
….infinite-retrying
….infinite-retrying
….infinite-retrying
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #3050 +/- ##
==========================================
+ Coverage 53.43% 53.56% +0.13%
==========================================
Files 342 346 +4
Lines 52747 53805 +1058
==========================================
+ Hits 28185 28821 +636
- Misses 22947 23349 +402
- Partials 1615 1635 +20
... and 10 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
// TableSkipError is a custom error type to capture if a table load is skipped because of a previously failed table load | ||
type TableSkipError struct { | ||
tableName string | ||
previousJobID int64 | ||
previousJobError string | ||
} | ||
|
||
func (tse *TableSkipError) Error() string { | ||
return fmt.Sprintf("Skipping %s table because it previously failed to load in an earlier job: %d with error: %s", tse.tableName, tse.previousJobID, tse.previousJobError) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing this as we are now avoiding TableSkipError.
102e08b
to
e0a2216
Compare
warehouse/upload_test.go
Outdated
@@ -6,20 +6,20 @@ import ( | |||
"fmt" | |||
"os" | |||
"testing" | |||
time2 "time" | |||
|
|||
"github.com/aws/smithy-go/time" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we using this package for our tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me remove this. Not sure why we are using this.
f4b6b21
to
77b103f
Compare
warehouse/upload.go
Outdated
panic(err) | ||
// Previous upload and table upload failed | ||
exportingfailedStatus = func(status string) bool { | ||
return status == TableUploadExportingFailed || status == UserTableUploadExportingFailed || status == IdentityTableUploadExportingFailed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[minor] & opinionated
return status == TableUploadExportingFailed || status == UserTableUploadExportingFailed || status == IdentityTableUploadExportingFailed | |
switch status { | |
case TableUploadExportingFailed, UserTableUploadExportingFailed, IdentityTableUploadExportingFailed: | |
return true | |
default: | |
return false | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should consider moving this logic outside of this function. Maybe it could be part of the table upload model, or introduce a separate failure flag.
The concern I have is when we introduce a new failed state we might forget to add it here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the other 2 flags were not being used. Removing this.
_, err := db.Exec(`INSERT INTO wh_uploads (id, destination_id, source_id, in_progress, destination_type, status, namespace, schema, created_at, updated_at) | ||
VALUES | ||
(1, 1, 1, true, 'RS', 'exporting_data', 'test_namespace', '{}', NOW(), NOW()), | ||
(2, 1, 1, true, 'RS', 'aborted', 'test_namespace', '{}', NOW(), NOW()) | ||
`) | ||
require.NoError(t, err) | ||
|
||
_, err = db.Exec(`INSERT INTO wh_table_uploads (id, wh_upload_id, table_name, status, error, created_at, updated_at) | ||
VALUES | ||
(1, 1, 'test_table_1','exporting_data', '{}', NOW(), NOW()), | ||
(2, 1, 'test_table_2','exporting_data_failed', 'error loading data', NOW(), NOW()) | ||
`) | ||
require.NoError(t, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has be modified with repository in this #3087
Description
retries causing succeeded tables to get retried again
, during export, the oldest exporting goroutines set it to true in case of successful exports for that goroutine.Notion Ticket
https://www.notion.so/rudderstacks/infinite-retries-a61e259c0b9349bfb5485083298d6baf?pvs=4
Security