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

Report unsupported database options under unsupported query constructs #2270

Merged
merged 17 commits into from
Feb 6, 2025

Conversation

priyanshi-yb
Copy link
Contributor

@priyanshi-yb priyanshi-yb commented Jan 29, 2025

Describe the changes in this pull request

Reporting the CREATE DATABASE WITH [OPTIONS...] for the options not unsupported in >=PG12.
fixes #1994
Added advisory-locks, system-columns tests in issues-integrations tests
Removed 2.18 from the YB version list in issues-test.yml workflow

Describe if there are any user-facing changes

Screenshot 2025-01-29 at 6 49 41 PM

How was this pull request tested?

added unit tests and end-to-end test

Does your PR have changes that can cause upgrade issues?

Component Breaking changes?
MetaDB No
Name registry json No
Data File Descriptor Json No
Export Snapshot Status Json No
Import Data State No
Export Status Json No
Data .sql files of tables No
Export and import data queue No
Schema Dump No
AssessmentDB No
Sizing DB No
Migration Assessment Report Json No
Callhome Json No
YugabyteD Tables No
TargetDB Metadata Tables No

@priyanshi-yb priyanshi-yb requested review from sanyamsinghal and makalaaneesh and removed request for sanyamsinghal January 30, 2025 08:24
@priyanshi-yb priyanshi-yb marked this pull request as ready for review January 30, 2025 08:24
}

var databaseOptionsPG17Issue = issue.Issue{
Type: DATABASE_OPTIONS,
Copy link
Collaborator

Choose a reason for hiding this comment

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

let's have a different type for both these issues? Type should ideally be unique. Perhaps, name can be the same.

switch {
case testYbVersion.ReleaseType() == ybversion.V2_25_0_0.ReleaseType() && testYbVersion.GreaterThanOrEqual(ybversion.V2_25_0_0):
assert.NoError(t, err)
assertErrorCorrectlyThrownForIssueForYBVersion(t, fmt.Errorf(""), "", databaseOptionsPG15Issue)
Copy link
Collaborator

Choose a reason for hiding this comment

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

assertNoError, is enough, right? do we need the assertErrorCorrectlyThrownForIssueForYBVersion as well?

Copy link
Contributor Author

@priyanshi-yb priyanshi-yb Feb 5, 2025

Choose a reason for hiding this comment

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

In this function assertErrorCorrectlyThrownForIssueForYBVersion we also do the IsFixedIn check so I think it makes sense to run this as well?


defer conn.Close(context.Background())
_, err = conn.Exec(ctx, sql)
switch {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wait, why do we need this switch case? If it's 2.25, err will be empty, and assertErrorCorrectlyThrownForIssueForYBVersion will take care of it automatically, right?

Copy link
Contributor Author

@priyanshi-yb priyanshi-yb Feb 5, 2025

Choose a reason for hiding this comment

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

we need the switch case right, because firstly we are not marking this as fixed in 2.25 but the CREATE DATABASE works without error in the 2.25 so, we need to run this func assertErrorCorrectlyThrownForIssueForYBVersion with different expected and actual errors in different cases

Copy link
Collaborator

Choose a reason for hiding this comment

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

let's add a comment here as well to indicate that it is not actually supported in 2.25, but does not throw any error as such

Type: DATABASE_OPTIONS_PG15,
Name: "Database options",
Impact: constants.IMPACT_LEVEL_2,
Description: "Database options (%s) introduced in PostgreSQL 12 and later are not supported yet in YugabyteDB.",
Copy link
Collaborator

Choose a reason for hiding this comment

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

lets define this along with other description constant vars?

Comment on lines 418 to 424
func ProtoAsCreateDBStmtNode(msg protoreflect.Message) (*pg_query.CreatedbStmt, error) {
node, ok := msg.Interface().(*pg_query.CreatedbStmt)
if !ok {
return nil, fmt.Errorf("failed to cast msg to %s", PG_QUERY_CREATEDB_STMT_NODE)
}
return node, nil
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this unused?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hm yeah, missed removing it

@priyanshi-yb priyanshi-yb force-pushed the priyanshi/database-options branch from e10375e to 9d58b8c Compare February 5, 2025 13:59
Copy link
Collaborator

@makalaaneesh makalaaneesh left a comment

Choose a reason for hiding this comment

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

LGTM minor comment.
Thanks for the advisory locks/system columns test!


defer conn.Close(context.Background())
_, err = conn.Exec(ctx, sql)
switch {
Copy link
Collaborator

Choose a reason for hiding this comment

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

let's add a comment here as well to indicate that it is not actually supported in 2.25, but does not throw any error as such

@priyanshi-yb priyanshi-yb merged commit 223aa20 into main Feb 6, 2025
66 checks passed
@priyanshi-yb priyanshi-yb deleted the priyanshi/database-options branch February 6, 2025 05: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.

Report locale/collation default settings at database level as unsupported
3 participants