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

[Access] Always failover to EN on script exec err - v0.32 #5318

Merged
merged 2 commits into from
Jan 30, 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
5 changes: 4 additions & 1 deletion engine/access/rpc/backend/backend_scripts.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ func (b *backendScripts) executeScript(

case IndexQueryModeFailover:
localResult, localDuration, localErr := b.executeScriptLocally(ctx, scriptRequest)
if localErr == nil || isInvalidArgumentError(localErr) || status.Code(localErr) == codes.Canceled {
// Note: temporarily ignoring error types and falling back to ENs for ALL errors
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you link to an issue or PR to indicate when this can be switched back

Copy link
Contributor Author

@peterargue peterargue Jan 30, 2024

Choose a reason for hiding this comment

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

it's already switched on master/v0.33. this is just here to avoid backporting the changes since we're upgrading in 2 weeks

// This should only fallback for non-cadence errors, but on v0.32, some errors are hidden
// within a cadence runtime error, resulting in the incorrect error type being returned.
if localErr == nil || status.Code(localErr) == codes.Canceled {
return localResult, localErr
}
// Note: scripts that timeout are retried on the execution nodes since ANs may have performance
Expand Down
9 changes: 5 additions & 4 deletions engine/access/rpc/backend/backend_scripts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,10 +338,11 @@ func (s *BackendScriptsSuite) TestExecuteScriptWithFailover_SkippedForCorrectCod
err error
statusCode codes.Code
}{
{
err: cadenceErr,
statusCode: codes.InvalidArgument,
},
// Skipping failover for InvalidArgument temporarily disabled
// {
// err: cadenceErr,
// statusCode: codes.InvalidArgument,
// },
{
err: ctxCancelErr,
statusCode: codes.Canceled,
Expand Down
Loading