Suppose the following IDL:
struct Data { @key string name; long id; }
Scenario 1:
Suppose there are two writers (KEEP_ALL_HISTORY_QOS + RELIABLE_RELIABILITY_QOS)
in different nodes write the instances as the following order:
Writer 1 Writer 2
{ "A", 1 }
{ "A", 2 }
dispose "A"
Because of the network delay, reader deployed on same node as Writer 1 receives Writer 1's sample { "A", 1 } and diposed sample first.
What happened when Writer 2's sample { "A", 2 } arrived to reader? Does this sample { "A", 2 } will be delivered to application?
Scenario 2:
Suppose there is a writer (KEEP_LAST_HISTORY_QOS depth_1 + RELIABLE_RELIABILITY_QOS + TRANSIENT_LOCAL_DURABILITY_QOS)
publishes many Struct Data
instances and then dispose some of them.
Will the late-joining readers (KEEP_LAST_HISTORY_QOS depth_1 + RELIABLE_RELIABILITY_QOS + TRANSIENT_LOCAL_DURABILITY_QOS)
receive the disposed instances (instance state is NOT_ALIVE_DISPSED)?
If so, is that any QoS setting cant can prevent from that?
Good questions. See below
Scenario1:
With the default Qos settings the answer is yes. If a sample for instance with key name="A" arrives after the sample disposing the instance, the DataReader will consider that the instance has become "alive" again. You will get the new sample and you will also see an increment in the SampleInfo's disposed_generation_count.
To be robust to network timing/delays you do one of two things (or both)
Scenario2:
Yes, late-joiner readers will receive disposed instances. We realize this can be an issue for some systems and are looking into ways to better manage this in future releases. In the meantime there are some things you could do to avoid getting the disposed instances; essentially the ammount to different way to unregister the instances in the DataWriter after some delay so that they do not stay there forever:
Thanks for kind answer!
From the doc: autopurge_disposed_instances_delay is supported with durable DataWriter queues only for 0 and INFINITE values (finite values are not supported).
Does it mean that finite values(such as 10s) are not supported for not-volatile DataWriter?
If so, I have to set autopurge_disposed_instances_delay as 0.
Hi Zhang,
You may also want to refer to the documentation below for more information.
https://community.rti.com/static/documentation/connext-dds/7.0.0/doc/manuals/connext_dds_professional/users_manual/users_manual/InstanceState.htm#19.1_Instance_States
https://community.rti.com/static/documentation/connext-dds/7.0.0/doc/manuals/connext_dds_professional/users_manual/users_manual/Managing_Data_Instances__Working_with_Ke.htm#31.14.8_Consequences_of_Unpurged_Dispose_Messages
You can contact me at zklim@rti.com as well to discuss further on your use case and see if we can provide further advice