5.10. TopicQueries

5.10.1. [Major] Response to snapshot TopicQuery may have missed samples for instances that passed the TopicQuery filter

A response to a snapshot TopicQuery may not have included samples for an instance that passed the TopicQuery filter when the snapshot TopicQuery was received.

To understand the problem, assume a Topic on PatientData:

struct PatientData {
    @key long id;
    string name;
    string address;
};

Also assume that a DataReader creates a TopicQuery with the expression id = 1234 and that a DataWriter with KEEP_LAST = 1 responding to the TopicQuery has a sample for that instance. For example:

{1234, ‘Patient A', ‘Street 345’}

When the DataWriter starts responding to the TopicQuery, it registers the last sequence number available in the DataWriter queue. This is the snapshot TopicQuery cutoff sequence number (SN). Then, the DataWriter starts answering the TopicQuery.

Before the DataWriter has a chance to send the sample for patient 1234, a hospital employee updates the patient’s address as follows:

{1234, ‘Patient A', ‘Street 346’}

The new update will get an SN that is higher than the cutoff SN. As a result, the DataReader waiting for the TopicQuery response will not get any sample for patient 1234, which is wrong because the patient is still in the system.

This release has updated the TopicQuery implementation so that if the number of samples received for a TopicQuery is not equal to the number of samples published in response to the TopicQuery, the application is notified by setting a new flag DDS_INCOMPLETE_SNAPSHOT_TOPIC_QUERY on the last sample of the TopicQuery. This allows the application to detect incomplete snapshots and potentially reissue the TopicQuery.

In addition, for KEEP_LAST DataWriter configurations, the cutoff SN for a snapshot TopicQuery is re-evaluated if any sample is replaced (due to KEEP_LAST) while the TopicQuery is dispatched. This ensures more reliable data transmission.

For more information, see the Topic Queries chapter of the RTI Connext Core Libraries User’s Manual.

[RTI Issue ID CORE-14439]