Deliver initial samples to all readers

While commit a652ecb78e addressed most of
the issues with a new reader possibly not accepting all samples a proxy
writer published after it matched that reader, it failed to do so
properly for 2nd and later readers.  The cause was, once again,
prematurely considering the reader to be "in sync" with the proxy
writer and not requesting any old samples.

The desire to consider them "in sync" from the very beginning is that it
avoids a lot of network traffic.  With this commit, all new readers are
treated equally, despite the additional traffic that generates.

Signed-off-by: Erik Boasson <eb@ilities.com>
This commit is contained in:
Erik Boasson 2019-08-25 11:08:50 +02:00 committed by eboasson
parent 8ae5f706d0
commit 53ebc6a529

View file

@ -1890,7 +1890,7 @@ static void proxy_writer_add_connection (struct proxy_writer *pwr, struct reader
/* builtins really don't care about multiple copies or anything */ /* builtins really don't care about multiple copies or anything */
m->in_sync = PRMSS_SYNC; m->in_sync = PRMSS_SYNC;
} }
else if (!pwr->have_seen_heartbeat) else if (!pwr->have_seen_heartbeat || !rd->handle_as_transient_local)
{ {
/* Proxy writer hasn't seen a heartbeat yet: means we have no /* Proxy writer hasn't seen a heartbeat yet: means we have no
clue from what sequence number to start accepting data, nor clue from what sequence number to start accepting data, nor
@ -1919,14 +1919,6 @@ static void proxy_writer_add_connection (struct proxy_writer *pwr, struct reader
m->in_sync = PRMSS_SYNC; m->in_sync = PRMSS_SYNC;
m->u.not_in_sync.end_of_tl_seq = MAX_SEQ_NUMBER; m->u.not_in_sync.end_of_tl_seq = MAX_SEQ_NUMBER;
} }
else if (!rd->handle_as_transient_local)
{
/* volatile reader, writer has seen a heartbeat: it's in sync
(there is a risk of it getting some historical data: that
happens to be cached in the writer's reorder admin at this
point) */
m->in_sync = PRMSS_SYNC;
}
else else
{ {
/* transient-local reader; range of sequence numbers is already /* transient-local reader; range of sequence numbers is already