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 v1.43.2 migration failure #2450

Merged
merged 2 commits into from
Aug 25, 2021

Conversation

xin-hedera
Copy link
Collaborator

Description:

This PR fixes the v1.43.2 migration issue in our k8s environment.

  • change ownership of the temp table and the function in the sql script to the importer user

Related issue(s):

Fixes #2449

Notes for reviewer:

Manually tested locally with

postgres [9.6, 13.3]
and db.username same as / different than db.owner

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

Signed-off-by: Xin Li <xin.li@hedera.com>
Signed-off-by: Xin Li <xin.li@hedera.com>
@xin-hedera xin-hedera added bug Type: Something isn't working P1 parser Area: File parsing database Area: Database labels Aug 25, 2021
@xin-hedera xin-hedera added this to the Mirror 0.40.0 milestone Aug 25, 2021
@xin-hedera xin-hedera requested a review from a team August 25, 2021 16:14
@xin-hedera xin-hedera self-assigned this Aug 25, 2021
@sonarcloud
Copy link

sonarcloud bot commented Aug 25, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@codecov
Copy link

codecov bot commented Aug 25, 2021

Codecov Report

Merging #2450 (3c8cf5f) into main (545e340) will not change coverage.
The diff coverage is n/a.

❗ Current head 3c8cf5f differs from pull request most recent head 011c4e2. Consider uploading reports for the commit 011c4e2 to get more accurate results
Impacted file tree graph

@@            Coverage Diff            @@
##               main    #2450   +/-   ##
=========================================
  Coverage     90.83%   90.83%           
  Complexity     2432     2432           
=========================================
  Files           420      420           
  Lines         11593    11593           
  Branches       1013     1013           
=========================================
  Hits          10530    10530           
  Misses          732      732           
  Partials        331      331           

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 545e340...011c4e2. Read the comment docs.

$$ language plpgsql;

create trigger missing_token_account_trigger after insert
on account_balance_file
execute procedure add_missing_token_account_association();

Copy link
Member

Choose a reason for hiding this comment

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

You're modifying a migration that has already successfully ran in some environments. That's usually very bad to do. It might be fine to do here but you'll need to manually fixup the working environments or it'll complain of migration checksum mismatch.

Copy link
Contributor

Choose a reason for hiding this comment

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

Was gonna say wouldn't it be cleaner to just add this in V1.43.3?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think since it's not yet in a GA release, might be better to fix in the same migration script and manually fix the envs which are already on v0.39.0-rc1

Copy link
Member

Choose a reason for hiding this comment

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

The problem is V1.43.2 fails in one env but not another. So we can't just add a V1.43.3 to fix the failing env.

@xin-hedera xin-hedera merged commit 0ba7505 into main Aug 25, 2021
@xin-hedera xin-hedera deleted the rework-add-missing-token-account-associations branch August 25, 2021 22:29
xin-hedera added a commit that referenced this pull request Aug 25, 2021
- change ownership of the temp table and the function in the sql script to the importer user

Signed-off-by: Xin Li <xin.li@hedera.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Type: Something isn't working database Area: Database P1 parser Area: File parsing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Db migration v1.43.2 fails due to unable to drop objects without ownership
4 participants