Re: insert latency

Поиск
Список
Период
Сортировка
От Robellard, Michael
Тема Re: insert latency
Дата
Msg-id CA+saaMcfnA_R8TrLdJLoAYycRQ3y_p+VhaETSxpqx+WrWOTA2Q@mail.gmail.com
обсуждение исходный текст
Ответ на insert latency  (John de la Garza <john@jjdev.com>)
Список psycopg
This sounds like your transaction has not committed yet.

When we started implementing celery message queuing we would run into this all the time. To fix it we wrote a special piece of logic so that the messages for the message queue would not get queued until the commit occurred. This had the added benefit of not sending the message to the queue if the transaction rolled back.

On Thu, Apr 21, 2016 at 2:58 PM, John de la Garza <john@jjdev.com> wrote:
I have two programs running.  One process does an insert.  After the
insert a message is sent to a message bus.  Then the second process
responds to the message by inserting a new row that depends on the
primary key of the first insert.

Some times I get an integrity error from the second process.  I then
wait and try again with success.

When my first insert returns what does this mean?  Does it mean that
the DB has accepted the request and will do it soon?  Or does it mean
that the DB has accepted the request and it will now be available?

It seems like the answer is the former.


--
Sent via psycopg mailing list (psycopg@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/psycopg



--
Michael Robellard
(216)288-2745

В списке psycopg по дате отправления:

Предыдущее
От: John de la Garza
Дата:
Сообщение: insert latency
Следующее
От: Alexandre Freire da Silva Osorio
Дата:
Сообщение: compiler errors