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

Update tdigest_aggregate_support output for PG15+ #7849

Merged
merged 1 commit into from
Jan 20, 2025

Conversation

colm-mchugh
Copy link
Contributor

Regress test tdigest_aggregate_support has been failing since at least Citus 12.0, when tdigest extension is installed in Postgres. This appears to be because of an omission by commit 03832f3 and a change in the implementation of Postgres random() function (pg commit d4f109e4a). To reproduce the test diff:

  • Checkout tdigest and run make; make install
  • In citus regress directory run make check-multi or ./citus_tests/run_test.py tdigest_aggregate_support

There are two parts to this commit:

  1. Revert Output: xxxxx in EXPLAIN VERBOSE. Citus commit fe4ac51 normalized EXPLAIN VERBOSE output because of a change between pg12 and pg13. When pg12 support was no longer required, the rule was removed from normalize.sed and Output: xxxx was reverted in the impacted regress output files (03832f3), but tdigest_aggregate_support was omitted.

  2. Adjust the query results; the tdigest_aggregate_support test file has a comment verifying results - should be stable due to seed while inserting the data, if failure due to data these queries could be removed or check for certain ranges but the result values in this commit are consistent across citus 12.0 (pg 15), citus 12.1 (pg 16) and citus 13.0 (pg 17), or since the Postgres changed their implementation of random, so proposing to go with these results.

@colm-mchugh colm-mchugh requested a review from naisila January 17, 2025 20:54
Copy link

codecov bot commented Jan 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.42%. Comparing base (c55bc8c) to head (5425e0e).
Report is 2 commits behind head on release-13.0.

Additional details and impacted files
@@               Coverage Diff                @@
##           release-13.0    #7849      +/-   ##
================================================
- Coverage         89.48%   89.42%   -0.06%     
================================================
  Files               276      276              
  Lines             60063    60062       -1     
  Branches           7524     7523       -1     
================================================
- Hits              53747    53711      -36     
- Misses             4166     4198      +32     
- Partials           2150     2153       +3     

Copy link
Member

@naisila naisila left a comment

Choose a reason for hiding this comment

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

Thanks for the detailed PR description.

@naisila
Copy link
Member

naisila commented Jan 17, 2025

Quick question: would this work with PG14 as well? (given that we haven't dropped support for it)

@colm-mchugh colm-mchugh force-pushed the cmchugh/release-13.0-fix-tdigest-regress branch from f0a3b0d to 6f8423a Compare January 20, 2025 15:34
@colm-mchugh
Copy link
Contributor Author

Quick question: would this work with PG14 as well? (given that we haven't dropped support for it)

Citus 11.0 on PG14 was failing with different query results, possibly because of minor differences in floating-point calculations. Added an alternative regress output file for this, for completeness.

@colm-mchugh colm-mchugh force-pushed the cmchugh/release-13.0-fix-tdigest-regress branch from 6f8423a to 7181bcc Compare January 20, 2025 16:16
Regress test tdigest_aggregate_support has been failing since at least
Citus 11.0, because of an ommission by citus commit 03832f3 and a change
in the implementation of Postgres random() function (pg commit d4f109e4a)
To reproduce the test diff:
- Checkout tdigest from https://github.com/tvondra/tdigest and `make; make install`
- In citus regress directory run `make check-multi` or `./citus_tests/run_test.py tdigest_aggregate_support`

There are two parts to this commit:

1) Revert "Output: xxxxx" in EXPLAIN VERBOSE output.

Citus commit fe4ac51 normalized EXPLAIN VERBOSE output because of a change
between pg12 and pg13. When pg12 support was no longer required, the rule
was removed from normalize.sed and "Output: xxxx" was reverted in the
impacted regress output files (03832f3), but tdigest_aggregate_support
was ommitted (by 03832f3).

2) Adjust query results; the tdigest_aggregate_support test file has a comment:
 '-- verifying results - should be stable due to seed while inserting the data,
if failure due to data these queries could be removed or check for certain ranges',
but the result values in this commit are consistent across citus 12.0 (pg 15),
citus 12.1 (pg 16) and citus 13.0 (pg 17), or since the Postgres commit that
changed the implementation of random:
https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=d4f109e4a
 so proposing to go with these results.

Note: citus 11.0 (PG14.12) was failing with slightly different query
results, possibly due to floating point difference; added an alternative
regress output file for PG14.
@colm-mchugh colm-mchugh force-pushed the cmchugh/release-13.0-fix-tdigest-regress branch from 7181bcc to 5425e0e Compare January 20, 2025 21:13
@colm-mchugh colm-mchugh merged commit c2bc7ac into release-13.0 Jan 20, 2025
155 checks passed
@colm-mchugh colm-mchugh deleted the cmchugh/release-13.0-fix-tdigest-regress branch January 20, 2025 22:00
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.

2 participants