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

Piggy back archival uploading progress on heartbeat details #1963

Merged
merged 10 commits into from
Jun 19, 2019

Conversation

yycptt
Copy link
Contributor

@yycptt yycptt commented Jun 6, 2019

#1536

  • Fix and add unit tests
  • Clean up code

@yycptt yycptt requested a review from andrewjdawson2016 June 6, 2019 17:22
@yycptt yycptt changed the title Implementation Piggy back archival uploading progress on heartbeat details Jun 6, 2019
@yycptt yycptt marked this pull request as ready for review June 14, 2019 20:23
@yycptt
Copy link
Contributor Author

yycptt commented Jun 14, 2019

Also fixed #1959

@yycptt yycptt closed this Jun 14, 2019
@yycptt yycptt reopened this Jun 14, 2019
@yycptt yycptt closed this Jun 14, 2019
@yycptt yycptt reopened this Jun 14, 2019
@yycptt yycptt force-pushed the archival-heartbeat branch from 34e9cab to ff66bfa Compare June 14, 2019 20:46
Copy link
Contributor

@andrewjdawson2016 andrewjdawson2016 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking solid, thanks for doing all this unit test work as well :)

service/worker/archiver/activities.go Outdated Show resolved Hide resolved
service/worker/archiver/activities.go Show resolved Hide resolved
service/worker/archiver/activities.go Outdated Show resolved Hide resolved
currIteratorState, err := historyBlobIterator.GetState()
if err == nil {
progress.IteratorState = currIteratorState
progress.BlobPageToken = pageToken
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels weird to me that BlobPageToken and UploadedBlobs can become out of sync. The way I am reading this code is that progress.BlobPageToken represents the highest blob page you have successfully uploaded so far. But in the case where historyBlobIterator.GetState() returns error you get a progress which has a blob in UploadedBlobs with a higher page than progress.BlobPageToken

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated, but I still feel a little bit weird as I think progress.UploadedBlobs should always reflect what has been uploaded. In the case when GetState() returns an error, the blob is still uploaded successfully, so I think progress should still be updated.

service/worker/archiver/activities.go Show resolved Hide resolved
service/worker/archiver/archiver.go Outdated Show resolved Hide resolved
service/worker/archiver/archiver.go Show resolved Hide resolved
service/worker/archiver/util.go Outdated Show resolved Hide resolved
archiverTestMetrics.On("IncCounter", metrics.ArchiverScope, metrics.ArchiverDeleteLocalSuccessCount).Once()
archiverTestLogger.On("Error", mock.Anything, mock.Anything).Once()

env := s.NewTestWorkflowEnvironment()
env.OnActivity(uploadHistoryActivityFnName, mock.Anything, mock.Anything).Return(workflow.NewTimeoutError(shared.TimeoutTypeStartToClose))
env.OnActivity(deleteBlobActivityFnName, mock.Anything, mock.Anything).Return(nil)
env.OnActivity(uploadHistoryActivityFnName, mock.Anything, mock.Anything).Return(nil, workflow.NewTimeoutError(shared.TimeoutTypeStartToClose))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will add timeout details after client side test framework is fixed.

currIteratorState, err := historyBlobIterator.GetState()
if err == nil {
progress.IteratorState = currIteratorState
progress.BlobPageToken = pageToken
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated, but I still feel a little bit weird as I think progress.UploadedBlobs should always reflect what has been uploaded. In the case when GetState() returns an error, the blob is still uploaded successfully, so I think progress should still be updated.

@yycptt yycptt requested a review from andrewjdawson2016 June 17, 2019 19:14
Copy link
Contributor

@andrewjdawson2016 andrewjdawson2016 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am okay with either place for recoding blob uploaded, your call.

Looks good :)

@yycptt yycptt merged commit cd9417e into cadence-workflow:master Jun 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants