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

Import stuck on creating search indexes #1476

Closed
juggernautt opened this issue Aug 25, 2019 · 3 comments
Closed

Import stuck on creating search indexes #1476

juggernautt opened this issue Aug 25, 2019 · 3 comments

Comments

@juggernautt
Copy link

juggernautt commented Aug 25, 2019

I'm importing planet file to database, not binary file. 3 days before setups script started to create search indexes. Since then nothing changed, no errors, no changes.
From your experience do I have to wait more or is it stack?
I'm running this import with 128GB Ram and 2TB SSD.

@mtmail
Copy link
Collaborator

mtmail commented Aug 25, 2019

I've seen this before. On the postgresql database run

SELECT pid,
       usename,
       pg_blocking_pids(pid) AS blocked_by,
       query AS blocked_query
FROM pg_stat_activity; 

If you see a line

 pid  |  usename  | blocked_by | blocked_query
-------+-----------+------------+---------------------------------------------------------------------------
 99441 | nominatim | {100472}   | CREATE INDEX idx_placex_rank_search ON placex USING BTREE (rank_search) ;

and the blocked_by pid points to an autovacuum process it's save to stop the autovacuum process. Otherwise it will go on forever (well at least very very long)

E.g.

SELECT pg_terminate_backend(100472) FROM pg_stat_activity; 

You might need to watch and repeat this another 3-5 times. With your hardware the searchindex creation step shouldn't take longer than 3 hours total.

@juggernautt
Copy link
Author

juggernautt commented Aug 25, 2019

Meanwhile the process is ended. Next time I'll take closer look at theses autovacuum processes.
Thanks

@MatthiasLohr
Copy link
Contributor

Thanks, this issue helped a lot!

@mtmail mtmail changed the title Import stack on creating search indexes Import stuck on creating search indexes Jun 30, 2020
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

3 participants