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 pg17 test #7795

Merged
merged 2 commits into from
Dec 20, 2024
Merged

Fix pg17 test #7795

merged 2 commits into from
Dec 20, 2024

Conversation

naisila
Copy link
Member

@naisila naisila commented Dec 20, 2024

Copy link

codecov bot commented Dec 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (naisila/pg17_support@e4d48dc). Learn more about missing BASE report.

Additional details and impacted files
@@                   Coverage Diff                   @@
##             naisila/pg17_support    #7795   +/-   ##
=======================================================
  Coverage                        ?   89.60%           
=======================================================
  Files                           ?      274           
  Lines                           ?    59730           
  Branches                        ?     7451           
=======================================================
  Hits                            ?    53522           
  Misses                          ?     4075           
  Partials                        ?     2133           

@naisila naisila requested a review from m3hm3t December 20, 2024 12:48
@onurctirtir onurctirtir self-requested a review December 20, 2024 14:52
naisila and others added 2 commits December 20, 2024 17:59
There is a crash when running vanilla tests because of the
`citus.hide_citus_dependent_objects` GUC. We turn on this GUC only for
the pg vanilla tests. This GUC runs the following function
`HideCitusDependentObjectsOnQueriesOfPgMetaTables`. This function
doesn't take into account the new `mergeJoinCondition`. I rewrote the
function such that it checks for merge join conditions as well.

Relevant PG commit:
postgres/postgres@0294df2f1

The crash could be reproduced locally like the following:
```SQL
SET citus.hide_citus_dependent_objects TO on;

CREATE OR REPLACE FUNCTION
    pg_catalog.is_citus_depended_object(oid,oid)
    RETURNS bool
    LANGUAGE C
    AS 'citus', $$is_citus_depended_object$$;

-- try a system catalog
MERGE INTO pg_class c
USING (SELECT 'pg_depend'::regclass AS oid) AS j
ON j.oid = c.oid
WHEN MATCHED THEN
UPDATE SET reltuples = reltuples + 1
RETURNING j.oid;

CREATE VIEW classv AS SELECT * FROM pg_class;

MERGE INTO classv c
USING pg_namespace n
ON n.oid = c.relnamespace
WHEN MATCHED AND c.oid = 'pg_depend'::regclass THEN
UPDATE SET reltuples = reltuples - 1
RETURNING c.oid;
-- crash happens here
```
@naisila naisila force-pushed the naisila/fix_pg17_test branch from 6e03540 to 2fbbfdb Compare December 20, 2024 17:08
@naisila naisila removed the request for review from m3hm3t December 20, 2024 17:08
@naisila naisila merged commit c8c79ec into naisila/pg17_support Dec 20, 2024
33 of 41 checks passed
@naisila naisila deleted the naisila/fix_pg17_test branch December 20, 2024 17:09
@naisila naisila restored the naisila/fix_pg17_test branch December 20, 2024 17:11
@naisila naisila mentioned this pull request Dec 20, 2024
@naisila naisila deleted the naisila/fix_pg17_test branch December 20, 2024 17:13
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