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

fix(archive): Fix edge-cast error for archiving. Fixes #2427 #2434

Merged
merged 2 commits into from
Mar 13, 2020

Conversation

alexec
Copy link
Contributor

@alexec alexec commented Mar 13, 2020

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this is a chore.
  • The title of the PR is (a) conventional, (b) states what changed, and (c) suffixes the related issues number. E.g. "fix(controller): Updates such and such. Fixes #1234".
  • I have written unit and/or e2e tests for my change. PRs without these are unlike to be merged.
  • Optional. I've added My organization is added to the USERS.md.
  • I've signed the CLA and required builds are green.

// We assume that we're much more likely to be inserting rows that updating them, so we try and insert,
// and if that fails, then we update.
// There is no check for race condition here, last writer wins.
_, err := sess.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we take a different, alternative approach - delete any records from the archive table (which will cascade to labels) and then just insert the archive record and labels

Copy link
Member

Choose a reason for hiding this comment

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

👍

@codecov
Copy link

codecov bot commented Mar 13, 2020

Codecov Report

❗ No coverage uploaded for pull request base (master@7094433). Click here to learn what that means.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #2434   +/-   ##
=========================================
  Coverage          ?   13.15%           
=========================================
  Files             ?       71           
  Lines             ?    25230           
  Branches          ?        0           
=========================================
  Hits              ?     3318           
  Misses            ?    21475           
  Partials          ?      437
Impacted Files Coverage Δ
persist/sqldb/workflow_archive.go 0% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7094433...d1480af. Read the comment docs.

@alexec alexec marked this pull request as ready for review March 13, 2020 18:29
persist/sqldb/workflow_archive.go Outdated Show resolved Hide resolved
// We assume that we're much more likely to be inserting rows that updating them, so we try and insert,
// and if that fails, then we update.
// There is no check for race condition here, last writer wins.
_, err := sess.
Copy link
Member

Choose a reason for hiding this comment

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

👍

@alexec alexec merged commit 050a143 into argoproj:master Mar 13, 2020
@alexec alexec deleted the fix-bug branch March 13, 2020 23:51
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.

Updating the workflow archive entry for a retried workflow fails with "current transaction is aborted"
2 participants