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

Crashes PSQL when table has high Partition Count #56

Open
GEverding opened this issue Dec 1, 2022 · 2 comments
Open

Crashes PSQL when table has high Partition Count #56

GEverding opened this issue Dec 1, 2022 · 2 comments

Comments

@GEverding
Copy link

I've caused psql14 to crash multiple times trying to run pgmetrics with a hash partitioned table with 1024 partitions.

@GEverding
Copy link
Author

2022-12-01 19:30:09 UTC [915447]: user=,db=,app=,client= LOG:  server process (PID 1350804) was terminated by signal 7: Bus error
2022-12-01 19:30:09 UTC [915447]: user=,db=,app=,client= DETAIL:  Failed process was running:
        SELECT
          current_database() AS db, schemaname, tablename, reltuples::bigint AS tups, relpages::bigint AS pages, otta,
          ROUND(CASE WHEN otta=0 OR sml.relpages=0 OR sml.relpages=otta THEN 0.0 ELSE sml.relpages/otta::numeric END,1) AS tbloat,
          CASE WHEN relpages < otta THEN 0 ELSE relpages::bigint - otta END AS wastedpages,
          CASE WHEN relpages < otta THEN 0 ELSE bs*(sml.relpages-otta)::bigint END AS wastedbytes,
          CASE WHEN relpages < otta THEN '0 bytes'::text ELSE (bs*(relpages-otta))::bigint::text || ' bytes' END AS wastedsize,
          iname, ituples::bigint AS itups, ipages::bigint AS ipages, iotta,
          ROUND(CASE WHEN iotta=0 OR ipages=0 OR ipages=iotta THEN 0.0 ELSE ipages/iotta::numeric END,1) AS ibloat,
          CASE WHEN ipages < iotta THEN 0 ELSE ipages::bigint - iotta END AS wastedipages,
          CASE WHEN ipages < iotta THEN 0 ELSE (bs*(ipages-iotta))::bigint END AS wastedibytes,
          CASE WHEN ipages < iotta THEN '0 bytes' ELSE (bs*(ipages-iotta))::bigint::text || ' bytes' END AS wastedisize,
          CASE WHEN relpages < ott
2022-12-01 19:30:09 UTC [915447]: user=,db=,app=,client= LOG:  terminating any other active server processes

Seems to be a common problem. I'm pretty sure pgwatch2 did something very similar

@pashagolub
Copy link

It's not a pgmetrics and it's not a pgwatch2. You have misconfigured instance. Check your settings and tune memory, especially huge_pages

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

No branches or pull requests

2 participants