Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[20815] Only apply content filter to ALIVE changes (backport #4876) #4904

Merged
merged 3 commits into from
Jun 26, 2024

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Jun 6, 2024

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

  • Commit messages follow the project guidelines.

  • The code follows the style guidelines of this project.

  • Tests that thoroughly check the new feature have been added/Regression tests checking the bug and its fix have been added; the added tests pass locally

  • Any new/modified methods have been properly documented using Doxygen.

  • N/A: Any new configuration API has an equivalent XML API (with the corresponding XSD extension)

  • Changes are backport compatible: they do NOT break ABI nor change library core behavior.

  • Changes are API compatible.

  • N/A: New feature has been added to the versions.md file (if applicable).

  • N/A: New feature has been documented/Current behavior is correctly described in the documentation.

  • Applicable backports have been included in the description.

Reviewer Checklist

  • The PR has a milestone assigned.
  • The title and description correctly express the PR's purpose.
  • Check contributor checklist is correct.
  • Check CI results: changes do not issue any warning.
  • Check CI results: failing tests are unrelated with the changes.

This is an automatic backport of pull request #4876 done by [Mergify](https://mergify.com).

@mergify mergify bot added the conflicts Backport PR wich git cherry pick failed label Jun 6, 2024
Copy link
Contributor Author

mergify bot commented Jun 6, 2024

Cherry-pick of 9a64956 has failed:

On branch mergify/bp/2.6.x/pr-4876
Your branch is up to date with 'origin/2.6.x'.

You are currently cherry-picking commit 9a64956e2.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	new file:   include/fastrtps/types/DynamicLoanableSequence.hpp
	modified:   include/fastrtps/types/DynamicPubSubType.h
	modified:   src/cpp/CMakeLists.txt
	modified:   src/cpp/fastdds/publisher/filtering/ReaderFilterCollection.hpp
	new file:   src/cpp/rtps/reader/reader_utils.cpp
	new file:   src/cpp/rtps/reader/reader_utils.hpp
	modified:   test/blackbox/api/dds-pim/PubSubParticipant.hpp
	new file:   test/blackbox/api/dds-pim/PubSubTypeTraits.hpp
	modified:   test/blackbox/api/dds-pim/PubSubWriterReader.hpp
	modified:   test/blackbox/common/DDSBlackboxTestsContentFilter.cpp
	new file:   test/blackbox/types/dynamic_types_traits.hpp

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   src/cpp/rtps/reader/StatefulReader.cpp
	both modified:   src/cpp/rtps/reader/StatelessReader.cpp
	both modified:   test/blackbox/api/dds-pim/PubSubReader.hpp
	both modified:   test/blackbox/api/dds-pim/PubSubWriter.hpp
	both modified:   test/unittest/dds/publisher/CMakeLists.txt
	both modified:   test/unittest/statistics/dds/CMakeLists.txt

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@EduPonz EduPonz added this to the v2.6.9 milestone Jun 8, 2024
@EduPonz EduPonz added temporarily-blocked PR must be merged after another one and removed conflicts Backport PR wich git cherry pick failed labels Jun 8, 2024
@EduPonz
Copy link

EduPonz commented Jun 8, 2024

@EduPonz EduPonz requested a review from Mario-DL June 8, 2024 08:13
@github-actions github-actions bot added ci-pending PR which CI is running labels Jun 8, 2024
@EduPonz EduPonz requested review from Mario-DL and removed request for Mario-DL June 8, 2024 13:08
@EduPonz
Copy link

EduPonz commented Jun 8, 2024

@richiprosima please test discovery-server

* Refs #20815: Add regression test

Signed-off-by: eduponz <eduardoponz@eprosima.com>

* Refs #20815: Only apply filter to ALIVE changes

Signed-off-by: eduponz <eduardoponz@eprosima.com>

* Refs #20815: Rename change_is_relevant_for_filter argument

Signed-off-by: eduponz <eduardoponz@eprosima.com>

* Refs #20815: Refactor test

Signed-off-by: eduponz <eduardoponz@eprosima.com>

* Refs #20815: Cast loop index to uint16_t for assigning it to the key field

Signed-off-by: eduponz <eduardoponz@eprosima.com>

* Refs #20815: Refactor test so PubSubWriter can be used directly

Signed-off-by: eduponz <eduardoponz@eprosima.com>

* Refs #20815: Fix memory leak

Signed-off-by: eduponz <eduardoponz@eprosima.com>

* Refs #20815: Apply Mario's suggestions

Signed-off-by: eduponz <eduardoponz@eprosima.com>

* Refs #20815: Add type traits to PubSubWriterReader and PubSubParticipant

Signed-off-by: eduponz <eduardoponz@eprosima.com>

* Refs #20815: Default move ctor and assignment in DynamicLoanableSequence

Signed-off-by: eduponz <eduardoponz@eprosima.com>

* Refs #20815: Add doxygen in DynamicLoanableSequence

Signed-off-by: eduponz <eduardoponz@eprosima.com>

* Refs #20815: Delete copy semantic from DynamicLoanableSequence

Signed-off-by: eduponz <eduardoponz@eprosima.com>

* Refs #20815: Use alias for TypeTraits::DataListType in PubSub* classes

Signed-off-by: eduponz <eduardoponz@eprosima.com>

---------

Signed-off-by: eduponz <eduardoponz@eprosima.com>
(cherry picked from commit 9a64956)

Signed-off-by: eduponz <eduardoponz@eprosima.com>
…d functions

Signed-off-by: eduponz <eduardoponz@eprosima.com>
Signed-off-by: eduponz <eduardoponz@eprosima.com>
@EduPonz EduPonz removed the temporarily-blocked PR must be merged after another one label Jun 25, 2024
@EduPonz EduPonz requested review from EduPonz and removed request for Mario-DL June 25, 2024 07:33
@EduPonz
Copy link

EduPonz commented Jun 26, 2024

@richiprosima please test discovery-server

@Mario-DL Mario-DL added ready-to-merge Ready to be merged. CI and changes have been reviewed and approved. and removed ci-pending PR which CI is running labels Jun 26, 2024
@EduPonz EduPonz merged commit 7a7172a into 2.6.x Jun 26, 2024
16 of 18 checks passed
@EduPonz EduPonz deleted the mergify/bp/2.6.x/pr-4876 branch June 26, 2024 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge Ready to be merged. CI and changes have been reviewed and approved.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants