From 53ebc6a529ceacf3d60191ac18a68dd613c9e8b6 Mon Sep 17 00:00:00 2001 From: Erik Boasson Date: Sun, 25 Aug 2019 11:08:50 +0200 Subject: [PATCH] Deliver initial samples to all readers While commit a652ecb78e145fa936b8fef2f58f27ab0411245a 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 --- src/core/ddsi/src/q_entity.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/core/ddsi/src/q_entity.c b/src/core/ddsi/src/q_entity.c index 0cacf73..3b76930 100644 --- a/src/core/ddsi/src/q_entity.c +++ b/src/core/ddsi/src/q_entity.c @@ -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 */ 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 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->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 { /* transient-local reader; range of sequence numbers is already