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

materialize-redshift: fix logging of Store bindings with no data #2029

Merged
merged 1 commit into from
Oct 8, 2024

Conversation

williamhbaker
Copy link
Member

@williamhbaker williamhbaker commented Oct 8, 2024

Description:

We were always calling FinishedResourceCommit for bindings even if they had no data, which was resulting in bogus log lines. This fixes the logic to not invoke the logging mechanisms for bindings with no data.

Workflow steps:

(How does one use this feature, and how has it changed)

Documentation links affected:

(list any documentation links that you created, or existing ones that you've identified as needing updates, along with a brief description)

Notes for reviewers:

(anything that might help someone review this PR)


This change is Reviewable

@williamhbaker williamhbaker added the change:unplanned Unplanned change, useful for things like doc updates label Oct 8, 2024
@williamhbaker williamhbaker requested a review from a team October 8, 2024 17:36
Copy link
Contributor

@Alex-Bair Alex-Bair left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Member

@jgraettinger jgraettinger left a comment

Choose a reason for hiding this comment

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

LGTM

if _, err := txn.Exec(ctx, b.createStoreTableSQL); err != nil {
return fmt.Errorf("creating store table: %w", err)
}
if b.hasStores {
Copy link
Member

Choose a reason for hiding this comment

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

nit: can reduce indentation via:

if !b.hasStores {
  // Pass.
} else if b.mustMerge {
  ...
} else {
  ...
}

We were always calling `FinishedResourceCommit` for bindings even if they had no
data, which was resulting in bogus log lines. This fixes the logic to not invoke
the logging mechanisms for bindings with no data.
@williamhbaker williamhbaker merged commit 02692b5 into main Oct 8, 2024
50 of 52 checks passed
@williamhbaker williamhbaker deleted the wb/redshift-log-fix branch October 8, 2024 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
change:unplanned Unplanned change, useful for things like doc updates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants