eProsima / Fast-DDS

The most complete DDS - Proven: Plenty of success cases. Looking for commercial support? Contact info@eprosima.com
https://eprosima.com
Apache License 2.0
2.06k stars 738 forks source link

[20815] Only apply content filter to ALIVE changes #4876

Closed EduPonz closed 1 month ago

EduPonz commented 1 month ago

Description

Backport of #4835 to 2.x

This PR fixes a bug that caused the content filter to also be applied to unregister and disposed samples. Since in those messages the only fields populated (if any) are the ones annotated with @key, the unregister and dispose samples did not pass the filter (in general) and thus were being discarded. This caused several issues:

  1. When writing to more than 10 instances with default Qos (keep last 1, max_instances 10), only the first 10 samples were been received.
  2. In best effort, when setting the history depth and max instances appropriately, all samples were received, but calls to unregister or dispose followed by a write were triggering sample_lost events, as the received sequence numbers were not consecutive (because of the filtering out of the unregister/dispose).

This PR fixes these issues by only querying for sample relevance when the CacheChange kind is ALIVE.

@Mergifyio backport 2.13.x 2.10.x 2.6.x

Contributor Checklist

Reviewer Checklist

EduPonz commented 1 month ago

@Mergifyio backport 2.13.x 2.10.x 2.6.x

mergify[bot] commented 1 month ago

backport 2.13.x 2.10.x 2.6.x

✅ Backports have been created

* [#4902 [20815] Only apply content filter to ALIVE changes (backport #4876)](https://github.com/eProsima/Fast-DDS/pull/4902) has been created for branch `2.13.x` but encountered conflicts * [#4903 [20815] Only apply content filter to ALIVE changes (backport #4876)](https://github.com/eProsima/Fast-DDS/pull/4903) has been created for branch `2.10.x` but encountered conflicts * [#4904 [20815] Only apply content filter to ALIVE changes (backport #4876)](https://github.com/eProsima/Fast-DDS/pull/4904) has been created for branch `2.6.x` but encountered conflicts
EduPonz commented 1 month ago

@richiprosima please test this

EduPonz commented 1 month ago

@richiprosima please test discovery-server

EduPonz commented 1 month ago

@richiprosima please test discovery-server

EduPonz commented 1 month ago

@richiprosima please test discovery-server