Merge #1102: a commit re-considers the source when the client filter suppressed a newer version against the baseline that commit replaced — client no longer holds a superseded value
# Conflicts: # docs/DataConnections.md
This commit is contained in:
+9
@@ -143,6 +143,15 @@ internal sealed partial class DataSubscriptionSession
|
||||
item.LastPublished = owned.Version;
|
||||
var now = session._services.Clock.GetTimestamp();
|
||||
item.LastDeliveryTimestamp = now; item.NextDue = session.DueFor(now, item.Settings);
|
||||
// #1102: a newer version was suppressed while this value was in flight, against the baseline this commit just
|
||||
// replaced. If it equals the OLD baseline it was dropped, and without this the client would hold this
|
||||
// superseded value until the source changed again. Re-consider the source against the new baseline.
|
||||
if (item.SuppressedVersion > owned.Version)
|
||||
{
|
||||
item.SuppressedVersion = 0;
|
||||
if (item.LastConsidered > owned.Version) item.LastConsidered = owned.Version;
|
||||
session.MarkDirty(item.View.Source); session.QueueTick();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,6 +112,12 @@ internal sealed partial class DataSubscriptionSession : IDataSubscriptionTranspo
|
||||
internal IDisposable? BaselineCharge;
|
||||
internal SourceTicket? Ticket;
|
||||
internal long LastConsidered, LastPublished, NextDue = 0;
|
||||
/// <summary>
|
||||
/// #1102: the newest version the client filter suppressed on the worker, 0 once a later version was queued. The
|
||||
/// filter compares against the COMMITTED baseline, so a value still in flight (dequeued, not yet committed) can
|
||||
/// commit after it and make that suppression wrong; the commit re-considers the source then (see ValueDelivery).
|
||||
/// </summary>
|
||||
internal long SuppressedVersion;
|
||||
internal long? LastDeliveryTimestamp;
|
||||
internal long? QueuedDue;
|
||||
internal LinkedListNode<ulong>? WaitingNode;
|
||||
@@ -1094,7 +1100,8 @@ internal sealed partial class DataSubscriptionSession : IDataSubscriptionTranspo
|
||||
return;
|
||||
}
|
||||
item.LastConsidered = read.Sample.Version;
|
||||
if (!item.Filter.ShouldDeliver(read.Sample, item.Settings)) return;
|
||||
if (!item.Filter.ShouldDeliver(read.Sample, item.Settings)) { item.SuppressedVersion = read.Sample.Version; return; }
|
||||
item.SuppressedVersion = 0; // a queued newer value supersedes whatever an in-flight commit would re-consider
|
||||
}
|
||||
var version = read.Sample.Version;
|
||||
var delivery = MakeValue(item, read.Sample, read.ReceivedTimestamp, false, null, read: read);
|
||||
|
||||
Reference in New Issue
Block a user