Skip to content
Snippets Groups Projects
Commit 27d785d4 authored by Jason Hiser's avatar Jason Hiser :tractor:
Browse files

Fix race conditino in postgres startup/turbod

Use pg_isready in start_turbo to avoid race conditions during startup.

Fix typo in prepd output.
parent c843c887
No related branches found
No related tags found
1 merge request!2Resolve "Job Failed #170469"
Pipeline #12728 failed
......@@ -2,16 +2,23 @@
main()
{
# start postgres
service postgresql start
# wait for postres to start
while !pg_isready; do sleep 1; done;
# setup connections and env for turbod and prepd
export USER=root;
cd /turbo
source ./set_env_vars
sleep 10 # let postgres start
# start trubo
cd /tmp
/turbo/bin/turbod.exe > /tmp/turbod.log 2>&1 &
sleep 10 # let turbod start
# start prepd
/turbo/bin/prepd.exe > /tmp/prepd.log 2>&1
}
......
......@@ -63,7 +63,7 @@ void do_zafl(pqxx::connection &conn, int32_t log_id, const WorkUnit_t& work)
if(file_write != raw.size())
{
prepare();
txn->prepared("update_log")("Could create tmp output file. Out of disk space?\n")(work.getVersionID()).exec();
txn->prepared("update_log")("Couldn't create tmp output file. Out of disk space?\n")(work.getVersionID()).exec();
txn->prepared("mark_err")(work.getVersionID()).exec();
txn->commit();
txn = make_unique<pqxx::work>(conn);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment