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

fix(storage): correct direct connectivity check #11152

Merged
merged 8 commits into from
Nov 20, 2024
Merged

fix(storage): correct direct connectivity check #11152

merged 8 commits into from
Nov 20, 2024

Conversation

frankyn
Copy link
Contributor

@frankyn frankyn commented Nov 19, 2024

Raised in: raj-prince/custom-go-client-benchmark#31
Condition didn't check for empty {} which failed for multi-region and InterContinental GCE / bucket.
Added an additional integration test to check for this case.

@frankyn frankyn requested review from a team as code owners November 19, 2024 19:16
@product-auto-label product-auto-label bot added the api: storage Issues related to the Cloud Storage API. label Nov 19, 2024
err = CheckDirectConnectivitySupported(ctx, newMRBucketName)
if err == nil {
t.Fatalf("CheckDirectConnectivitySupported: error expected, got nil")
}
Copy link
Contributor

Choose a reason for hiding this comment

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

So this covers the multi-regional case. Should we add a few more cases? I think we should cover:

  1. single region, same region as VM (expect success)
  2. single region, diff region from VM (fail)

Same thing with dual region and multiregion.

We could probably refactor this as a table driven test to make it clearer.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

make sense! i'll work that next. thanks

}
if err != nil && !strings.Contains(err.Error(), "direct connectivity not detected") {
t.Fatalf("CheckDirectConnectivitySupported: failed on a different error %v", err)
if v, exists := attrs.Value("cloud.platform"); !exists || v.AsString() == "gcp_compute_engine" {
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this actually run in Kokoro or trigger the skip?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll trigger a job in kokoro; i was testing this in GCE first

}
gceRegion := v.AsString()
var otherRegion string
for _, r := range []string{"us-west1", "us-east1", "us-central1"} {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why does this need 3 regions if we're only picking one other?

Maybe just pick some non-US region that we never use for testing?

},
{
name: "dual-region bucket",
attrs: &BucketAttrs{Location: "NAM4"},
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this case repeated?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Typo :)

{
name: "dual-region bucket",
attrs: &BucketAttrs{Location: "NAM4"},
expectDirectConnectivity: true,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't expect NAM4 to return true.

@frankyn
Copy link
Contributor Author

frankyn commented Nov 20, 2024

Kokoro failed on
image
Flake ignoring.

attrs: &BucketAttrs{Location: "us-west1"},
expectDirectConnectivity: true,
},
{
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe have a TODO to add NAM4 with true as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

NAM4 wouldn't work in this case since it's a pairing of us-central1 and us-east1.
image

Need to create a new pairing with customPlacementConfig; I'll add a todo for customPlacement though.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ahh got it. Sounds good.

@frankyn frankyn enabled auto-merge (squash) November 20, 2024 05:15
@frankyn frankyn merged commit a75c8b0 into main Nov 20, 2024
9 checks passed
@frankyn frankyn deleted the fix-dp-check branch November 20, 2024 05:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the Cloud Storage API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants