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

Better peer checks #572

Merged
merged 5 commits into from
Dec 1, 2023
Merged

Better peer checks #572

merged 5 commits into from
Dec 1, 2023

Conversation

Amogh-Bharadwaj
Copy link
Contributor

@Amogh-Bharadwaj Amogh-Bharadwaj commented Oct 25, 2023

Fixes #482
Fixes #484
Also checks for dataset existence for BQ Peer. (This will also be applicable to UI)

@@ -141,8 +141,8 @@ func ValidCheck(s3Client *s3.S3, bucketURL string, metadataDB *metadataStore.Pos
}

func (c *S3Connector) ConnectionActive() bool {
_, err := c.client.ListBuckets(nil)
return err == nil
_, listErr := c.client.ListBuckets(nil)
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't seem like a strong enough check for the connection being active.
Something along the lines of the ValidCheck function seems better, the bucket seems to be constant anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The ValidCheck function is performed as part of validation

async fn validate_peer<'a>(&self, peer: &Peer) -> anyhow::Result<()> {
//if flow handler does not exist, skip validation
if self.flow_handler.is_none() {
return Ok(());
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this always happen? A lot of our peer types are not usable from the query layer and having flow not validate them doesn't seem strong enough.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only Eventhub and Eventhub Group are not covered by our validation API

@heavycrystal
Copy link
Contributor

If Snowflake/BigQuery are using an external stage, ConnectionActive() should validate that as well.

@Amogh-Bharadwaj Amogh-Bharadwaj merged commit 27fe4dc into main Dec 1, 2023
12 checks passed
@serprex serprex deleted the better-peer-checks branch July 19, 2024 15:20
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.

Refactor Peer Validation To Use API Validate Peer Create PEER SF check if database exists
3 participants