Skip to content

pg_pathman creates thousands partitions #16

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

Closed
SonicGD opened this issue Jun 23, 2016 · 5 comments
Closed

pg_pathman creates thousands partitions #16

SonicGD opened this issue Jun 23, 2016 · 5 comments
Assignees
Labels

Comments

@SonicGD
Copy link

SonicGD commented Jun 23, 2016

Hello! Today for the second time we faced strange pg_pathman behavior.

Base table:

CREATE TABLE prices
(
linkId integer NOT NULL,
date integer NOT NULL,
price double precision NOT NULL
);

Range partition:

SELECT create_range_partitions('prices', 'date', '1451606400'::int, '2419200'::int);

Before "problem" last partition was "prices_7". last record date was 1466663582. Then we insert 3 records with date=1466664722. And... pathman put them into partition "prices_2007". So we have "prices_7", 2000 empty partitions and 3 records in "prices_2007".

We dropped all empty partitions, but serveral minutes later pathman writes new records to "prices_2766" starting with date=1466665444. 722 seconds and 759 new partitions =)

Right now we have "prices_3373" and i think it will keep growing.

What can we do to help fix this problem? We have similar problem with other table in other db and fixed it by recreate whole table from scratch. I'm going to do same thing here, but if you need some additional info - it can wait for several hours.

UPD: Almost forgot versions! Postgres 9.5.3 (https://hub.docker.com/_/postgres/), pg_pathman from master (2775b5a)

@SonicGD
Copy link
Author

SonicGD commented Jun 23, 2016

"prices_4373" now and it's empty

@SonicGD
Copy link
Author

SonicGD commented Jun 23, 2016

Had to drop table, cause server went to restart loop with many warnings:

WARNING:  Partitions 115613 and 74860 overlap. Disabling pathman for relation 74754...
WARNING:  Partitions 74860 and 111965 overlap. Disabling pathman for relation 74754...
WARNING:  Partitions 111965 and 115619 overlap. Disabling pathman for relation 74754...
WARNING:  Partitions 115619 and 74866 overlap. Disabling pathman for relation 74754...
WARNING:  Partitions 74866 and 111971 overlap. Disabling pathman for relation 74754...
WARNING:  Partitions 111971 and 115625 overlap. Disabling pathman for relation 74754...
WARNING:  Partitions 115625 and 74872 overlap. Disabling pathman for relation 74754...
WARNING:  Partitions 74872 and 111977 overlap. Disabling pathman for relation 74754...
WARNING:  Partitions 111977 and 115631 overlap. Disabling pathman for relation 74754...
WARNING:  Partitions 115631 and 74878 overlap. Disabling pathman for relation 74754...
WARNING:  Partitions 74878 and 111983 overlap. Disabling pathman for relation 74754...
WARNING:  Partitions 111983 and 115637 overlap. Disabling pathman for relation 74754...
WARNING:  Partitions 115637 and 74884 overlap. Disabling pathman for relation 74754...

@zilder
Copy link
Collaborator

zilder commented Jun 30, 2016

Hi @SonicGD,
Thank you for your report! I couldn't yet reproduce your case, but it's not the first time someone reports similar problem. In all cases it was table partitioned by integer timestamp attribute.

Then we insert 3 records with date=1466664722. And... pathman put them into partition "prices_2007". So we have "prices_7", 2000 empty partitions and 3 records in "prices_2007".

Could you remember were there any warnings or errors before you inserted new rows? Do you use x86-64 architecture or something else?

What can we do to help fix this problem?

A dump of original table would be helpful : ) It'll be great if you could upload dump somewhere on dropbox or google drive!

@zilder
Copy link
Collaborator

zilder commented Jun 30, 2016

And if you could reproduce (or still have) problem, a dump of partitions could be helpful as well

@funbringer
Copy link
Collaborator

Looks like there's nothing more to discuss at the moment. Feel free to give us a feedback in case you're in trouble.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants