Skip to content

Clear build events from previous resource/resource type check - #6211

Merged
aoldershaw merged 1 commit into
masterfrom
clear-check-build-events
Oct 26, 2020
Merged

aoldershaw merged 1 commit into
masterfrom
clear-check-build-events

Conversation

@aoldershaw

Copy link
Copy Markdown
Contributor

What does this PR accomplish?

Bug Fix | Feature | Documentation

With #6022, we delete the previous build for a resource/resource type
check when we create a new one. However, since there's no foreign key
contraint on build_events.build_id, the build events never actually get
deleted.

We actually don't want a cascading delete on build_events, though, since
deleting pipelines would become super slow (currently, we're able to
just truncate/drop the pipeline_build_events table, but if deletes
cascaded, we'd end up performing a ton of row deletions, which is much
slower in postgres). So instead, let's just delete the build events when
we delete the corresponding build.

Changes proposed by this PR:

Notes to reviewer:

Release Note

Contributor Checklist

Reviewer Checklist

  • Code reviewed
  • Tests reviewed
  • Documentation reviewed
  • Release notes reviewed
  • PR acceptance performed
  • New config flags added? Ensure that they are added to the
    BOSH and
    Helm packaging; otherwise, ignored for
    the integration
    tests

    (for example, if they are Garden configs that are not displayed in the
    --help text).

With #6022, we delete the previous build for a resource/resource type
check when we create a new one. However, since there's no foreign key
contraint on build_events.build_id, the build events never actually get
deleted.

We actually don't want a cascading delete on build_events, though, since
deleting pipelines would become super slow (currently, we're able to
just truncate/drop the pipeline_build_events table, but if deletes
cascaded, we'd end up performing a ton of row deletions, which is much
slower in postgres). So instead, let's just delete the build events when
we delete the corresponding build.

Signed-off-by: Aidan Oldershaw <[email protected]>
@aoldershaw
aoldershaw marked this pull request as ready for review October 26, 2020 18:29
@aoldershaw
aoldershaw merged commit e0f1100 into master Oct 26, 2020
@aoldershaw
aoldershaw deleted the clear-check-build-events branch October 26, 2020 19:21
@aoldershaw aoldershaw added the release/no-impact This is an issue that never affected released versions (i.e. a regression caught prior to shipping). label Oct 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

misc release/no-impact This is an issue that never affected released versions (i.e. a regression caught prior to shipping).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants