移动帖子到长主题失败

我知道我可能已经超出了合理的帖子移动数量,现在它会失败并显示消息:

移动帖子时出错。

我试图将 19 篇帖子从一个包含 1,500 篇帖子的主题移动到一个包含 4,500 篇帖子的主题。

不过,如果能有解决方案那就太好了。

移动到新主题可以正常工作。

Unicorn worker 收到 USR2 信号,表明即将超时,正在转储主线程的回溯
config/unicorn.conf.rb:203:in `backtrace'
config/unicorn.conf.rb:203:in `block (2 levels) in reload'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rack-mini-profiler-3.3.1/lib/patches/db/pg.rb:110:in `exec'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rack-mini-profiler-3.3.1/lib/patches/db/pg.rb:110:in `async_exec'
(eval at /var/www/discourse/lib/method_profiler.rb:38):29:in `async_exec'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/mini_sql-1.6.0/lib/mini_sql/postgres/connection.rb:217:in `run'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/mini_sql-1.6.0/lib/mini_sql/active_record_postgres/connection.rb:38:in `block in run'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/mini_sql-1.6.0/lib/mini_sql/active_record_postgres/connection.rb:34:in `block in with_lock'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/concurrency/null_lock.rb:9:in `synchronize'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/mini_sql-1.6.0/lib/mini_sql/active_record_postgres/connection.rb:34:in `with_lock'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/mini_sql-1.6.0/lib/mini_sql/active_record_postgres/connection.rb:38:in `run'
/var/www/discourse/lib/mini_sql_multisite_connection.rb:109:in `run'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/mini_sql-1.6.0/lib/mini_sql/postgres/connection.rb:196:in `exec'
(eval at /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/mini_sql-1.6.0/lib/mini_sql/builder.rb:62):2:in `exec'
/var/www/discourse/app/models/topic_user.rb:511:in `update_post_action_cache'
/var/www/discourse/app/models/post_mover.rb:634:in `update_statistics'
/var/www/discourse/app/models/post_mover.rb:116:in `move_posts_to'
/var/www/discourse/app/models/post_mover.rb:35:in `block in to_topic'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract/transaction.rb:6...
activesupport-7.2.2.1/lib/active_support/broadcast_logger.rb:130:in `block in warn'
activesupport-7.2.2.1/lib/active_support/broadcast_logger.rb:231:in `block in dispatch'
activesupport-7.2.2.1/lib/active_support/broadcast_logger.rb:231:in `each'
activesupport-7.2.2.1/lib/active_support/broadcast_logger.rb:231:in `dispatch'
activesupport-7.2.2.1/lib/active_support/broadcast_logger.rb:130:in `warn'
/var/www/discourse/lib/signal_trap_logger.rb:40:in `public_send'
/var/www/discourse/lib/signal_trap_logger.rb:40:in `block (2 levels) in ensure_logging_thread_running'
internal:kernel:187:in `loop'
/var/www/discourse/lib/signal_trap_logger.rb:37:in `block in ensure_logging_thread_running'

我使用的是最新的核心版本 b6f62bcc05

是否仍有将逻辑移至 sidekiq 的计划?

3 个赞

有一个关于类似问题的最新帖子:

如果你不在最新版本,可以尝试更新一下。

2 个赞

我注意到……

2 个赞

我们可以为您争取更多时间,轻松地将其移至延迟队列,这样可以提供 90 秒而不是 30 秒的工作时间。

我有点担心这里花费的时间太长,更新统计信息似乎是我们应该在帖子移动后稍后进行的操作。

3 个赞

我已经暂时完成了劫持,但是的,这里很可能还有很多其他的优化要做:

3 个赞