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 PostgreSQL metastore migration script failure if indexes already exist #6066

Conversation

tigrulya-exe
Copy link
Contributor

🔍 Description

Issue References 🔗

This pull request is a small fix for #5674

Describe Your Solution 🔧

PostgreSQL support as backend for metadata store was added in #6027. If we choose it and run schema init scripts several times, then the following errors will be logged: Error executing sql: CREATE UNIQUE INDEX unique_identifier_index ON metadata(identifier), with params: . ERROR: relation "unique_identifier_index" already exists. This PR adds lacking IF NOT EXISTS to db indexes creation ddls in the PostgreSQL metastore init script.

Types of changes 🔖

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Test Plan 🧪

Behavior Without This Pull Request ⚰️

Behavior With This Pull Request 🎉

Related Unit Tests


Checklist 📝

@pan3793 pan3793 added this to the v1.9.0 milestone Feb 20, 2024
@pan3793 pan3793 closed this in 3a76507 Feb 20, 2024
@pan3793
Copy link
Member

pan3793 commented Feb 20, 2024

Thanks, merged to master

zhaohehuhu pushed a commit to zhaohehuhu/incubator-kyuubi that referenced this pull request Mar 21, 2024
…e if indexes already exist

# 🔍 Description
## Issue References 🔗

This pull request is a small fix for apache#5674

## Describe Your Solution 🔧

PostgreSQL support as backend for metadata store was added in apache#6027. If we choose it and run schema init scripts several times, then the following errors will be logged: `Error executing sql: CREATE UNIQUE INDEX unique_identifier_index ON metadata(identifier), with params: . ERROR: relation "unique_identifier_index" already exists`. This PR adds lacking `IF NOT EXISTS` to db indexes creation ddls in the PostgreSQL metastore init script.

## Types of changes 🔖

- [x] Bugfix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)

## Test Plan 🧪

#### Behavior Without This Pull Request ⚰️

#### Behavior With This Pull Request 🎉

#### Related Unit Tests

---

# Checklist 📝

- [x] This patch was not authored or co-authored using [Generative Tooling](https://www.apache.org/legal/generative-tooling.html)

Closes apache#6066 from tigrulya-exe/feature/5674-postgresql-metadata-backend.

Closes apache#6066

bb6487c [Tigran Manasyan] Fix PostgreSQL metastore migration script failure if indexes already exist

Authored-by: Tigran Manasyan <t.manasyan@arenadata.io>
Signed-off-by: Cheng Pan <chengpan@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants