-
Notifications
You must be signed in to change notification settings - Fork 80
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
Add log stored status explicitly #760
Conversation
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.
/assign @gabemontero @enarha
@khrm: GitHub didn't allow me to assign the following users: gabemontero. Note that only tektoncd members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
"k8s.io/apimachinery/pkg/types" | ||
) | ||
|
||
// LogRecordType represents the API resource type for Tekton log records. | ||
const LogRecordType = "results.tekton.dev/v1alpha2.Log" | ||
const LogRecordType = "results.tekton.dev/v1alpha3.Log" | ||
const LogRecordTypeV2 = "results.tekton.dev/v1alpha2.Log" |
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 need this also because some of the Type stored in DB can be v2.
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.
ack @khrm good catch
pkg/api/server/v1alpha2/log/log.go
Outdated
func ToStream(ctx context.Context, record *db.Record, config *config.Config) (Stream, *v1alpha2.Log, error) { | ||
if record.Type != v1alpha2.LogRecordType { | ||
func ToStream(ctx context.Context, record *db.Record, config *config.Config) (Stream, *v1alpha3.Log, error) { | ||
if record.Type != v1alpha3.LogRecordType || record.Type != v1alpha3.LogRecordTypeV2 { |
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 need V2 here because it can be v2 also. So I added that,
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.
/kind feature
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
4b5450e
to
28d50ea
Compare
/test pull-tekton-results-build-tests |
The following is the coverage report on the affected files.
|
/test pull-tekton-results-unit-tests |
The following is the coverage report on the affected files.
|
/test pull-tekton-results-integration-tests |
/test pull-tekton-results-build-tests |
/test pull-tekton-results-unit-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.
/assign @gabemontero
@khrm: GitHub didn't allow me to assign the following users: gabemontero. Note that only tektoncd members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
The following is the coverage report on the affected files.
|
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.
/assign @gabemontero
@khrm: GitHub didn't allow me to assign the following users: gabemontero. Note that only tektoncd members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/hold I am testing various scenarios atm. I will cancel the hold tomorrow after I finish testing. |
Path string `json:"path,omitempty"` | ||
Size int64 `json:"size"` | ||
IsStored bool `json:"isStored"` | ||
ErrorOnStoreMsg string `json:"errorOnStoreMsg"` |
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.
yeah per my comment https://github.com/tektoncd/results/pull/704/files#r1630064603 @khrm lets add an errorOnStoreCode int
as well
@avinal @sayan-biswas fyi
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.
Do we use errorcode
for streaming? We aren't using grpc code during streaming.
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.
@khrm consider the old prototype for using this change over in #713
I want that call in the watcher's dynamic.go to not just check if it is stored, and if it is not, requeue to consider pruning later.
I want it to also see that if it is not stored per the update made in pkg/api/server/v1alpha2/logs.go 's handleReturn
(where it has the original "error"), but because of an error on the api server side, to see if the particular error is one of the grpc intermittent sort of hiccups that mean we can re-attempt the log storage.
In this way, we finally address the lack of retry on error that @sayan-biswas @avinal @enarha and myself have lamented for months.
Now, if there is some flaw in the way I've connected the dots here, then let's you @khrm, myself, @avinal @sayan-biswas @enarha discuss either here on in the next WG call.
As a backup, I'm also fine with setting a boolean "IsRetrablyErrorOccurred" field. in LogStatus
, have the handleReturn code make the decision if the error that occured in an intermittent, retryable sort of thing, and then the dynamic.go code works off of that to try the UpdateLog
call again.
thanks
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.
I have added a new field for this.
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.
LGTM @khrm thanks
@enarha @avinal @sayan-biswas as I am not in the OWNERS file anywhere, we need reviews from you all to get this finally merged.
PTAL
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.
just the one additional field on the LogStatus
obj @khrm
thanks
/hold cancel |
I have also tested the following scenarios now:
|
The following is the coverage report on the affected files.
|
- adding log stored stored status explictly in the Log object improves the detection for partial or no storage of logs - it might help mitigate the race condition between pruning the runs and storing the logs. Signed-off-by: Avinal Kumar <[email protected]> Signed-off-by: Khurram Baig <[email protected]>
The following is the coverage report on the affected files.
|
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.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: avinal, gabemontero The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Changes
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you review them:
/kind <type>
. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tepRelease Notes