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

INTMDB-247: Fixes a bug where it's taking 3 minutes to read a cluster #530

Merged
merged 4 commits into from
Aug 27, 2021

Conversation

coderGo93
Copy link
Contributor

@coderGo93 coderGo93 commented Aug 25, 2021

Description

  • Deleted the delay of 3 minutes which is the reason why it "hangs" in order to read a cluster with datasource
  • Tested manually but modified the terratest to verify it works
  • In tests, if you create with private link it should take to read from 1:30min to 3min at most, if you use directly datasource to get other values, it should be immediately to get a result
    Results:

Original (with 3 minutes delay)

mongodbatlas_privatelink_endpoint_service.atlaseplink: Creation complete after 2m13s [id=ZW5kcG9pbnRfc2VydmljZV9pZA==:dnBjZS0wOWNiNDMxNWNlNTQ1NDRiMQ==-cHJpdmF0ZV9saW5rX2lk:NjEyNTliM2UxZDZkMjc1OTg2ZDc3ZGE4-cHJvamVjdF9pZA==:NWNmNWE0NWE5Y2NmNjQwMGU2MDk4MWI2-cHJvdmlkZXJfbmFtZQ==:QVdT]
data.mongodbatlas_cluster.cluster-atlas: Reading...
data.mongodbatlas_cluster.cluster-atlas: Still reading... [10s elapsed]
data.mongodbatlas_cluster.cluster-atlas: Still reading... [20s elapsed]
data.mongodbatlas_cluster.cluster-atlas: Still reading... [30s elapsed]
data.mongodbatlas_cluster.cluster-atlas: Still reading... [40s elapsed]
data.mongodbatlas_cluster.cluster-atlas: Still reading... [50s elapsed]
data.mongodbatlas_cluster.cluster-atlas: Still reading... [1m0s elapsed]
data.mongodbatlas_cluster.cluster-atlas: Still reading... [1m10s elapsed]
data.mongodbatlas_cluster.cluster-atlas: Still reading... [1m20s elapsed]
data.mongodbatlas_cluster.cluster-atlas: Still reading... [1m30s elapsed]
data.mongodbatlas_cluster.cluster-atlas: Still reading... [1m40s elapsed]
data.mongodbatlas_cluster.cluster-atlas: Still reading... [1m50s elapsed]
data.mongodbatlas_cluster.cluster-atlas: Still reading... [2m0s elapsed]
data.mongodbatlas_cluster.cluster-atlas: Still reading... [2m10s elapsed]
data.mongodbatlas_cluster.cluster-atlas: Still reading... [2m20s elapsed]
data.mongodbatlas_cluster.cluster-atlas: Still reading... [2m30s elapsed]
data.mongodbatlas_cluster.cluster-atlas: Still reading... [2m40s elapsed]
data.mongodbatlas_cluster.cluster-atlas: Still reading... [2m50s elapsed]
data.mongodbatlas_cluster.cluster-atlas: Still reading... [3m0s elapsed]
data.mongodbatlas_cluster.cluster-atlas: Read complete after 3m1s [id=61256b8ce70fbb7cf8ad6eee]

Actual (depending, it can take from 1:30 min to 3min to read a cluster after private link)

aws_vpc_endpoint.ptfe_service: Creation complete after 8s [id=vpce-0e3cb9799ae7f2238]
mongodbatlas_privatelink_endpoint_service.atlaseplink: Creating...
mongodbatlas_privatelink_endpoint_service.atlaseplink: Still creating... [10s elapsed]
mongodbatlas_privatelink_endpoint_service.atlaseplink: Still creating... [20s elapsed]
mongodbatlas_privatelink_endpoint_service.atlaseplink: Still creating... [30s elapsed]
mongodbatlas_privatelink_endpoint_service.atlaseplink: Still creating... [40s elapsed]
mongodbatlas_privatelink_endpoint_service.atlaseplink: Still creating... [50s elapsed]
mongodbatlas_privatelink_endpoint_service.atlaseplink: Still creating... [1m0s elapsed]
mongodbatlas_privatelink_endpoint_service.atlaseplink: Still creating... [1m10s elapsed]
mongodbatlas_privatelink_endpoint_service.atlaseplink: Still creating... [1m20s elapsed]
mongodbatlas_privatelink_endpoint_service.atlaseplink: Still creating... [1m30s elapsed]
mongodbatlas_privatelink_endpoint_service.atlaseplink: Still creating... [1m40s elapsed]
mongodbatlas_privatelink_endpoint_service.atlaseplink: Still creating... [1m50s elapsed]
mongodbatlas_privatelink_endpoint_service.atlaseplink: Still creating... [2m0s elapsed]
mongodbatlas_privatelink_endpoint_service.atlaseplink: Still creating... [2m10s elapsed]
mongodbatlas_privatelink_endpoint_service.atlaseplink: Still creating... [2m20s elapsed]
mongodbatlas_privatelink_endpoint_service.atlaseplink: Creation complete after 2m24s [id=ZW5kcG9pbnRfc2VydmljZV9pZA==:dnBjZS0wZTNjYjk3OTlhZTdmMjIzOA==-cHJpdmF0ZV9saW5rX2lk:NjEyNjY4MGE5YWMxMmUwM2I2NzgyMzFm-cHJvamVjdF9pZA==:NWNmNWE0NWE5Y2NmNjQwMGU2MDk4MWI2-cHJvdmlkZXJfbmFtZQ==:QVdT]
data.mongodbatlas_cluster.cluster-atlas: Reading...
data.mongodbatlas_cluster.cluster-atlas: Still reading... [10s elapsed]
data.mongodbatlas_cluster.cluster-atlas: Still reading... [20s elapsed]
data.mongodbatlas_cluster.cluster-atlas: Still reading... [30s elapsed]
data.mongodbatlas_cluster.cluster-atlas: Still reading... [40s elapsed]
data.mongodbatlas_cluster.cluster-atlas: Still reading... [50s elapsed]
data.mongodbatlas_cluster.cluster-atlas: Still reading... [1m0s elapsed]
data.mongodbatlas_cluster.cluster-atlas: Still reading... [1m10s elapsed]
data.mongodbatlas_cluster.cluster-atlas: Still reading... [1m20s elapsed]
data.mongodbatlas_cluster.cluster-atlas: Read complete after 1m22s [id=61256b8ce70fbb7cf8ad6eee]

If you use directly for other purposes, the result should be immediately

Link to any related issue(s):
#521

Type of change:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Documentation fix/enhancement

Required Checklist:

  • I have signed the MongoDB CLA
  • I have read the Terraform contribution guidelines
  • I have added tests that prove my fix is effective or that my feature works per HashiCorp requirements
  • I have added any necessary documentation (if appropriate)
  • I have run make fmt and formatted my code

Further comments

@themantissa themantissa requested review from a team, threebee, themantissa, abner-dou and thetonymaster and removed request for andreaangiolillo and a team August 25, 2021 16:43
@themantissa themantissa requested review from gssbzn and removed request for threebee August 25, 2021 18:14
Copy link
Collaborator

@themantissa themantissa left a comment

Choose a reason for hiding this comment

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

LGTM

@coderGo93 coderGo93 added the run-testacc To run acceptance tests label Aug 26, 2021
@gssbzn
Copy link
Collaborator

gssbzn commented Aug 26, 2021

Tests are failing here

Copy link
Collaborator

@gssbzn gssbzn left a comment

Choose a reason for hiding this comment

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

Not familiar enough (yet) with the tests so let's make sure there's not a regression from this change

@coderGo93
Copy link
Contributor Author

Tested manually and it worked.
User cases:

  • If you create a cluster then datasource of cluster(without private endpoints), it work immediately
  • If you create a cluster then datasource of cluster with private endpoints, it should get the result immediately

Has the approval, you can merge now @themantissa .

FYI: For some reason the normal test fails because it doesn't get the env var(secrets) even I set in the fork repo

@themantissa
Copy link
Collaborator

@coderGo93 deleted my comment as you posted while I was writing mine. If the tests are failing because of env var we should figure that out before merging. Please figure it out and once it passes I'll merge.

@coderGo93 coderGo93 self-assigned this Aug 27, 2021
@themantissa themantissa merged commit 6995d9c into mongodb:master Aug 27, 2021
@themantissa themantissa linked an issue Aug 31, 2021 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
run-testacc To run acceptance tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants