فشل إعادة التعيين بسبب الجمود

I’ve got a large database (9.2 million posts) with a bunch of mega-topics (some > 150K posts!). When I try to do a restore to another server, I get something like this when it’s doing the remap to a new host name.

Restoring uploads, this may take a while...                                                   
Optimizing site icons...                                                                                      
Posts will be rebaked by a background job in sidekiq. You will see missing images until that has completed.
You can expedite the process by manually running "rake posts:rebake_uncooked_posts"  
EXCEPTION: ERROR:  deadlock detected                                              
DETAIL:  Process 960 waits for ShareLock on transaction 4765; blocked by process 2184.                   
Process 2184 waits for ShareLock on transaction 4915; blocked by process 960.                                    HINT:  See server log for query details.
CONTEXT:  while updating tuple (566294,13) in relation "posts"                                         

Is there something that I can do to resolve this deadlock?

This was on an 8GB standard droplet.

When trying to do a rebake I have had a similar issue with this site on a reasonably fast database server with 16GB of ram and a separate web server with 16GB of ram. Both were also serving some other fairly small and low-volume sites.

Does it seem likely that it’s the megatopics? Is there a solution other than splitting them into smaller ones?

إعجاب واحد (1)

It’s a lot easier if you stop running the web and sidekiq processes during the remap, so there is nothing competing locks.

4 إعجابات

Thanks so much! This fixed it. And, so obvious once you suggested it.

3 إعجابات

sorry to bring this up we encounter the same problem.

how to stop the web and sidekiq proccesses?

Since you’re using a development environment, you just type control-c

in docker how should we stop it?

  sv stop unicorn
  sv stop sidekiq
إعجاب واحد (1)

unicorn is the web right?

إعجاب واحد (1)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.