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

[YSQL] Fix org.yb.pgsql.TestYsqlUpgrade#migratingIsEquivalentToReinitdb test #25743

Open
1 task done
mdbridge opened this issue Jan 24, 2025 · 1 comment
Open
1 task done
Labels
area/ysql Yugabyte SQL (YSQL) kind/bug This issue is a bug priority/medium Medium priority issue status/awaiting-triage Issue awaiting triage

Comments

@mdbridge
Copy link
Contributor

mdbridge commented Jan 24, 2025

Jira Link: DB-15025

Description

This test, run by:

ybd  --java-test 'org.yb.pgsql.TestYsqlUpgrade#migratingIsEquivalentToReinitdb'

fails if it is run on a operating system that has a different version of glibc from the version in the saved system catalog snapshot it compares against.

The error looks like:

[ERROR] migratingIsEquivalentToReinitdb(org.yb.pgsql.TestYsqlUpgrade)  Time elapsed: 88.813 s  <<< FAILURE!
java.lang.AssertionError: 
Table 'pg_collation': Column #11 (collversion) mismatch: expected:<2.39> but was:<2.28>
Expected row: Row[oid=java.lang.Long::1234567890,collname=java.lang.String::en_US,collnamespace=java.lang.Long::11,collowner=java.lang.Long::10,collprovider=java.lang.String::c,collisdeterministic=java.lang.Boolean::true,collencoding=java.lang.Integer::6,collcollate=java.lang.String::en_US.utf8,collctype=java.lang.String::en_US.utf8,colliculocale=null,collversion=java.lang.String::2.39]
Actual row:   Row[oid=java.lang.Long::1234567890,collname=java.lang.String::en_US,collnamespace=java.lang.Long::11,collowner=java.lang.Long::10,collprovider=java.lang.String::c,collisdeterministic=java.lang.Boolean::true,collencoding=java.lang.Integer::6,collcollate=java.lang.String::en_US.utf8,collctype=java.lang.String::en_US.utf8,colliculocale=null,collversion=java.lang.String::2.28]
	at org.yb.pgsql.TestYsqlUpgrade.lambda$assertMigrationsWorked$62(TestYsqlUpgrade.java:1897)
	at org.yb.pgsql.TestYsqlUpgrade.assertMigrationsWorked(TestYsqlUpgrade.java:1887)
	at org.yb.pgsql.TestYsqlUpgrade.migratingIsEquivalentToReinitdb(TestYsqlUpgrade.java:1076)

Here the operating system the test is being run on has glibc version 2.39 but the snapshot was made on a system with 2.28.

You can easily find out the glibc version by the following command:

$ ldd --version
ldd (GNU libc) 2.28

The code that takes this version and puts it in pg_collation table is:

~/code/yugabyte-db/src/postgres/src/backend/utils/adt/pg_locale.c:1716:
		/* Use the glibc version because we don't have anything better. */
		collversion = pstrdup(gnu_get_libc_version());

Probably fixing the test means making it ignore this field. For testing purposes, you can hardwire a different version above and it will make the test fail currently.

Issue Type

kind/bug

Warning: Please confirm that this issue does not contain any sensitive information

  • I confirm this issue does not contain any sensitive information.
@mdbridge mdbridge added area/ysql Yugabyte SQL (YSQL) status/awaiting-triage Issue awaiting triage labels Jan 24, 2025
@yugabyte-ci yugabyte-ci added kind/bug This issue is a bug priority/medium Medium priority issue labels Jan 24, 2025
@mdbridge
Copy link
Contributor Author

Minghui Yang said:
Not obvious to me how to make the test change to ignore that field. That field is only set on Linux, so one work around is to avoid that code if in YB context, and we get same behavior on Mac and Linux. It does have the risk of missing the version mismatch check when running pg_upgrade, but en_US.utf8 is a common collation which may not easily subject to libc version changes so I think it is quite stable. None of the other libc collations are supported by YB.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ysql Yugabyte SQL (YSQL) kind/bug This issue is a bug priority/medium Medium priority issue status/awaiting-triage Issue awaiting triage
Projects
None yet
Development

No branches or pull requests

2 participants