9388: Process each notify individually instead attempting to batch them up.
authorPeter Amstutz <peter.amstutz@curoverse.com>
Thu, 9 Jun 2016 21:55:37 +0000 (17:55 -0400)
committerPeter Amstutz <peter.amstutz@curoverse.com>
Fri, 10 Jun 2016 14:04:39 +0000 (10:04 -0400)
commitb0e9a800435e6231317e5123c9b6a1b5b6397a5e
tree823662365278a957912752daca7bd2f1cb95a23a
parent84b538b627cba20558e0a52f3efe73eec90a46fe
9388: Process each notify individually instead attempting to batch them up.

Prior to this commit, websockets used to try to send log events out in batches,
by getting all logs with an id greater than last log that was sent.
Unfortunately, under concurrent database writes, logs from uncommited
transactions may not appear in the query even if logs with larger ids do
appear.  This results in the uncommitted log never being sent out because
subsequent batch sends would not consider logs prior to the last log id that
was sent (which, in this case, is higher than the log that was missed.)

This commit eliminates the batching behavior.  Because NOTIFY includes the log
id of a specific record that was committed, consider only the log record with
that id and process events in the order that the NOTIFY events arrive.  This
means events may be delivered out of numeric order (although they now more
closely reflect the "actual" order, e.g. the order that the events were
actually committed to the database).

"Catch ups" where the client has specified a last_log_id and needs to have past
logs replayed continue to be sent in batches.
sdk/python/arvados/commands/ws.py
services/api/lib/eventbus.rb