Skip to content

feat(gcp)!: Initialization concurrency#10700

Merged
kodiakhq[bot] merged 6 commits intocloudquery:mainfrom
bbernays:gcp-initalization-concurrency
May 15, 2023
Merged

feat(gcp)!: Initialization concurrency#10700
kodiakhq[bot] merged 6 commits intocloudquery:mainfrom
bbernays:gcp-initalization-concurrency

Conversation

@bbernays
Copy link
Copy Markdown
Collaborator

Summary

We currently try and use the same concurrency value that we use for resolving all tables for parallelizing ListServices when the default is used then the concurrency can overload the credential provider as seen by user on discord.

This PR creates a separate concurrency option that enables users to have a large sync concurrency but a much more limited initialization concurrency

@bbernays bbernays requested review from disq and yevgenypats as code owners May 10, 2023 18:13
@bbernays bbernays changed the title feat(gcp!): Initalization concurrency feat(gcp)!: Initialization concurrency May 10, 2023
@cq-bot cq-bot added the gcp label May 10, 2023
ProjectFilter string `json:"project_filter"`
BackoffDelay int `json:"backoff_delay"`
BackoffRetries int `json:"backoff_retries"`
DiscoveryConcurrency *int `json:"discovery_concurrency"`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'd suggest to keep it a plain value and check for 0 instead of nil

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Since 0 would be meaningless (not a good idea to have infinite concurrency?) keeping it plain is an option, OTOH having this as a pointer is a better way of signalling to the user (or code reader/maintainer) that this is an optional value. Can go either way.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I was trying to keep the same style as FolderRecursionDepth on line 8


var defaultDiscoveryConcurrency = 100
if spec.DiscoveryConcurrency == nil {
spec.DiscoveryConcurrency = &defaultDiscoveryConcurrency
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You could define defaultDiscoveryConcurrency inside the block.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I was trying to match the style in lines 19-21...

@hermanschaaf
Copy link
Copy Markdown
Contributor

Why is this marked as a breaking change? Can it not be done in a backwards-compatible way?

@disq
Copy link
Copy Markdown
Member

disq commented May 11, 2023

Why is this marked as a breaking change? Can it not be done in a backwards-compatible way?

It's not really a 'certain breaking change' if we're lowering the default discovery from thousands to 100, but it might still break some orgs that need the higher discovery concurrency (if it works, at all). Making the default value same as the concurrency val would make it non-breaking but I'm guessing we don't want that as the default because it doesn't really work most of the time?

@bbernays
Copy link
Copy Markdown
Collaborator Author

I marked it as breaking because if a user had adjusted concurrency to a value other than default this would now change their configuration.

@bbernays bbernays added the automerge Automatically merge once required checks pass label May 15, 2023
@kodiakhq kodiakhq bot merged commit 0c9f510 into cloudquery:main May 15, 2023
kodiakhq bot pushed a commit that referenced this pull request May 25, 2023
🤖 I have created a release *beep* *boop*
---


## [9.0.0](plugins-source-gcp-v8.5.1...plugins-source-gcp-v9.0.0) (2023-05-25)


### ⚠ BREAKING CHANGES

* This release introduces an internal change to our type system to use [Apache Arrow](https://arrow.apache.org/). This should not have any visible breaking changes, however due to the size of the change we are introducing it under a major version bump to communicate that it might have some bugs that we weren't able to catch during our internal tests. If you encounter an issue during the upgrade, please submit a [bug report](https://github.com/cloudquery/cloudquery/issues/new/choose).
* **gcp:** Initialization concurrency ([#10700](#10700))
* **gcp:** Make Listing Enabled Services failures not block the sync ([#10699](#10699))

### Features

* **deps:** Upgrade to Apache Arrow v13 (latest `cqmain`) ([#10605](#10605)) ([a55da3d](a55da3d))
* **gcp:** Enable Better Logging for when `enabled_services_only` fails ([#10695](#10695)) ([a849aea](a849aea))
* **gcp:** Initialization concurrency ([#10700](#10700)) ([0c9f510](0c9f510))
* **gcp:** Make Listing Enabled Services failures not block the sync ([#10699](#10699)) ([5b49481](5b49481))
* Update to use [Apache Arrow](https://arrow.apache.org/) type system ([612d3ea](612d3ea))


### Bug Fixes

* **deps:** Update module github.com/cloudquery/plugin-pb-go to v1.0.8 ([#10798](#10798)) ([27ff430](27ff430))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
@BenitezDev
Copy link
Copy Markdown

I am not able to find the documentation for this change, is there any?

@bbernays bbernays deleted the gcp-initalization-concurrency branch June 1, 2023 14:39
@hermanschaaf
Copy link
Copy Markdown
Contributor

hermanschaaf commented Jun 1, 2023

@BenitezDev Good point, I think we missed it on this one! Opened an issue so we don't forget: #11170

In short you should be able to set discovery_concurrency at the same level as other options like backoff_retries. It defaults to 100

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge Automatically merge once required checks pass

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants