حلقة لا نهائية أثناء ترقية postgres

Hi! Each time I launch /launcher rebuild app I get the following message (even if I launch it again) :

UPGRADE OF POSTGRES COMPLETE
Old 9.5 database is stored at /shared/postgres_data_old
To complete the upgrade, rebuild again using:
./launcher rebuild app

What information do you need to help me?

PS: The first time I ran it, the command stoped because I needed more space

Temporarily, I used the templates/postgres.9.5.template.yml template to avoid downtime. The app is running again, but I’d like to finish the update.

When I do a cleanup I get the following message : Old PostgreSQL backup data cluster detected taking up 1.2G detected. Would you like to remove it? (Y/n):

Sounds like a question for @tgxworld, but I am guessing that it failed due to lack of space but somehow didn’t catch that the upgrade had failed.

How much space do you have? And how big is your database?

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

Can you provide me with the full log generated during the rebuild? Thank you!

3 إعجابات

أواجه نفس المشكلة منذ أشهر عديدة ولا أستطيع ترقية تثبيتي.

تدخل في حلقة لا تنتهي أبدًا. إحدى المشاكل التي تظهر أثناء تنفيذ rebuild app هي:
mv: cannot move '/shared/postgres_data' to '/shared/postgres_data_old': Device or resource busy

عند الدخول إلى حاوية Docker، فإن إصدار PostgreSQL الذي أملكه هو:

/usr/lib/postgresql/10/bin/postgres --version
postgres (PostgreSQL) 10.14 (Debian 10.14-1.pgdg100+1)

هذه هي الأخطاء التي أحصل عليها:

FAILED

--------------------

Pups::ExecError: /root/upgrade_postgres failed with return #<Process::Status: pid 47 exit 1>

Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'

exec failed with the params "/root/upgrade_postgres"

0c74c9de4d4315b63c0ef9055631f38c0cf4b3dd0be6500fd83ca0a5b13e0d9d

** FAILED TO BOOTSTRAP ** الرجاء التمرير للأعلى والبحث عن رسائل الأخطاء السابقة، فقد يكون هناك أكثر من خطأ.

قد يساعد ./discourse-doctor في تشخيص المشكلة.

يبدو أن هناك مشكلة في السكربت /pups/lib/pups/exec_command.rb عند تنفيذ spawn.

ومع ذلك، يمكنني تشغيل التطبيق:
./launcher start app

هذه هي الملفات الموجودة تحت /shared:

total 48
drwxr-xr-x 12 root      root     4096 Jan 12 13:12 .
drwxr-xr-x 57 root      root     4096 Dec 15 09:09 ..
drwxr-xr-x  3 discourse www-data 4096 Aug 20  2019 backups
drwxr-xr-x  4 root      root     4096 Aug 19  2019 log
drwxr-xr-x  2 postgres  postgres 4096 Aug 19  2019 postgres_backup
drwx------ 20 postgres  postgres 4096 Jan 12 13:14 postgres_data
drwx------ 19 postgres  postgres 4096 Jan 12 13:12 postgres_data_new
drwxrwxr-x  5 postgres  postgres 4096 Jan 12 13:14 postgres_run
drwxr-xr-x  2 redis     redis    4096 Jan 12 13:07 redis_data
drwxr-xr-x  4 root      root     4096 Aug 19  2019 state
drwxr-xr-x  4 discourse www-data 4096 Jan 12 13:14 tmp
drwxr-xr-x  4 discourse www-data 4096 Sep  8  2019 uploads

ما الذي يمكنني فعله؟

هل الدليل المشترك لديك هو نقطة ربط شبكية من نوع ما؟

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

لا، لكنني تمكنت من إنجاز الأمر في النهاية!

أمرَا mv الموجودان في templates/postgres.template.yml لا يتم التحقق من صحتهما. فالنصيف يقول دائمًا UPGRADE OF POSTGRES COMPLETE، وهو ما ليس صحيحًا عند حدوث خطأ في النقل.

لقد قمت بإزالة الأمرين، ثم نقلت المجلدات يدويًا بعد الدخول إلى Docker، والآن يعمل أمر rebuild app التالي كما كان من قبل! أنا سعيد جدًا :smiley:
شكرًا لك.

3 إعجابات

لقد واجهت هذه المشكلة أثناء آخر ترقية من PostgreSQL 13 إلى 15.

في عملية النشر الخاصة بنا، يتم تحميل الدليل /shared/postgres_data الخاص بنا على جهاز تخزين NVMe أسرع، لذلك فشلت عملية النقل برسالة خطأ “الجهاز أو المورد مشغول”.

لقد قمنا بإصلاح هذا عن طريق تصحيح قالب postgres على النحو التالي:

diff --git a/templates/postgres.template.yml b/templates/postgres.template.yml
index c24bfe6..03813c4 100644
--- a/templates/postgres.template.yml
+++ b/templates/postgres.template.yml
@@ -139,8 +139,10 @@ run:
           fi

-         mv /shared/postgres_data /shared/postgres_data_old
-         mv /shared/postgres_data_new /shared/postgres_data
+         mkdir /shared/postgres_data_old
+         mv /shared/postgres_data/* /shared/postgres_data_old
+         mv /shared/postgres_data_new/* /shared/postgres_data
+         rmdir /shared/postgres_data_new

بدلاً من محاولة معالجة الدليل نفسه، فقط قم بنقل المحتويات.

يرجى النظر في دمج هذا التغيير لتحسين موثوقية ترقيات قاعدة البيانات.

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

أعتقد أن هذا قد يكون ذا صلة: FIX: improve postgres upgrade reliability by jcharaoui · Pull Request #989 · discourse/discourse_docker · GitHub

إعجابَين (2)

تم دمج طلب السحب :+1:

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

تم إغلاق هذا الموضوع تلقائيًا بعد 6 أيام. لم يعد يُسمح بالردود الجديدة.