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

[Service fabric] Retry for remaining commands #7607

Merged
merged 3 commits into from
Jul 4, 2018

Conversation

bishal-pdMSFT
Copy link
Contributor

No description provided.

@bishal-pdMSFT
Copy link
Contributor Author

Ping


# If upgrade already started, don't retry
$upgradeStatus = Get-ServiceFabricApplicationUpgradeAction -ApplicationName $($UpgradeParameters["ApplicationName"])
if ($upgradeStatus -and ($upgradeStatus.UpgradeState -ne "RollingBackCompleted" -and $upgradeStatus.UpgradeState -ne "RollingForwardCompleted"))
Copy link
Member

Choose a reason for hiding this comment

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

You dont need to put braces for the 2nd expression. However, I m not clear on the logic here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it is checking if upgrade is already in progress (status should not be RollingBackCompleted or RollingForwardCompleted). if so, it will not retry starting upgrade.

Copy link
Member

Choose a reason for hiding this comment

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

But you are returning false in those cases, wouldn't that stop the retry?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, that is intended. The action being tried here is Start-Upgrade.. If upgrade has already started even though the call failed due to timeout, we would not like to try further.
Only in case of upgrade not started, we want to retry

Copy link
Member

Choose a reason for hiding this comment

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

How do we differentiate between the last upgrade vs the current upgrade

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if current is first upgrade for application, upgrade status will be null, otherwise it will be RollingForwardCompleted or RollingBackCompleted depending upon whether last upgrade was success or rolled back

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is the same logic which we use while waiting for upgrade to finish

Copy link
Member

Choose a reason for hiding this comment

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

Is there a chance for us to not even attempt retry if the server didn't even accept our retry request.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is nothing like server will not accept request. It will accept and either fail or proceed with upgrade. In either of these cases we don't want to retry.

Copy link
Member

Choose a reason for hiding this comment

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

Make sense

)

$global:operationId = $SF_Operations.RemoveApplicationPackage
$removeAction = { Remove-ServiceFabricApplicationPackage -ApplicationPackagePathInImageStore $applicationPackagePathInImageStore -ImageStoreConnectionString $ImageStoreConnectionString }
Copy link
Member

Choose a reason for hiding this comment

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

the casing in $application starts with lower case

Copy link
Contributor Author

Choose a reason for hiding this comment

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

#fixed

psr.run(path.join(__dirname, 'UnregisterApplicationTypeShouldRetry.ps1'), done);
})
it('Create application type should retry till success', (done) => {
psr.run(path.join(__dirname, 'CreateApplicationShouldRetryTillSuccess.ps1'), done);
Copy link
Member

Choose a reason for hiding this comment

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

was this file already present

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, they were part of previous PR. However, during conflict resolution, these changes were reverted in that PR.

@sachinma sachinma self-assigned this Jul 3, 2018
# Conflicts:
#	Tasks/ServiceFabricDeployV1/ServiceFabricSDK/Publish-UpgradedServiceFabricApplication.ps1
@bishal-pdMSFT bishal-pdMSFT merged commit ebe288d into master Jul 4, 2018
kuvinodms pushed a commit that referenced this pull request Jul 16, 2018
* Retry for remaining commands

* PR comment
kuvinodms pushed a commit that referenced this pull request Jul 17, 2018
* Retry for remaining commands

* PR comment
kuvinodms pushed a commit that referenced this pull request Jul 17, 2018
* [ServiceFabric] Re-tries for Unregister, connect, create and remove commands (#7588)

* Re-tries for copy and register commands

* PR comments

* PR comments and few suggestion as per Oana

* connect, unregister, create, remove re-tries

* L0 for unregister retry

* L0 for create and remove application

* Utilities changes which were not picked in merge

* PR comments

* Moving retry logic for UpgradeApplication to corresponding helper fun… (#7593)

* Moving retry logic for UpgradeApplication to corresponding helper function

* Updated function name

* Added new operation

* Indentation

* Adding timeout exception

* [Service fabric] Retry for remaining commands (#7607)

* Retry for remaining commands

* PR comment

* Adding logs for upgrade service fabric application. (#7217)

* Adding logs for upgrade service fabric application.

* resolving comments

* Forming upgrade errors message.

* Formatting unhealthy evaluation and upgrade status.

* fixed merge changes

* Formatting UnhealthyEvaluation and DomainUpgradeStatus while printing only conditionally.

* Moved waiting for upgrade to complete and printing logic to function in Utilities file.

* Keeping other exception as well.

* Implemented async operations (#7631)

* Implemented Async operations

* Added null checks

* Modified code as per review comments

* typo

* Revert "typo"

This reverts commit f04d14e.

* Revert "Modified code as per review comments"

This reverts commit e24bc53.

* Modified code as per review comments

* Modified code as per review comments

* Addressed review comments

* Added retry logic to Wait-ServiceFabricApplicationTypeRegistrationStatus

* Added comments

* Addressed review comments

* typo

* Added comments

* typo

* Addressed review comments

* Updated test cases

* Modified code as per review comments

* Users/hiyada/s ftask log bug fixes (#7722)

* Corrected typo.

* Corrected retry message null check

* Addressed bugs raised as a part of bugbash (#7739)

* Added powershell helper module

* Replacing Trace-VstsEnteringInvocation with print statement

* Removing Trace-VstsLeavingInvocation $MyInvocation

* Addressed review comments

* Updated patch version (#7748)
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.

3 participants