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) #4902

Merged
merged 3 commits into from
Jun 11, 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.13.x/pr-4876
Your branch is up to date with 'origin/2.13.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
	modified:   test/blackbox/api/dds-pim/PubSubReader.hpp
	new file:   test/blackbox/api/dds-pim/PubSubTypeTraits.hpp
	modified:   test/blackbox/api/dds-pim/PubSubWriter.hpp
	modified:   test/blackbox/api/dds-pim/PubSubWriterReader.hpp
	modified:   test/blackbox/common/DDSBlackboxTestsContentFilter.cpp
	new file:   test/blackbox/types/dynamic_types_traits.hpp
	modified:   test/unittest/dds/publisher/CMakeLists.txt

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/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

* Refs #20815: Add regression test

Signed-off-by: eduponz <[email protected]>

* Refs #20815: Only apply filter to ALIVE changes

Signed-off-by: eduponz <[email protected]>

* Refs #20815: Rename change_is_relevant_for_filter argument

Signed-off-by: eduponz <[email protected]>

* Refs #20815: Refactor test

Signed-off-by: eduponz <[email protected]>

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

Signed-off-by: eduponz <[email protected]>

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

Signed-off-by: eduponz <[email protected]>

* Refs #20815: Fix memory leak

Signed-off-by: eduponz <[email protected]>

* Refs #20815: Apply Mario's suggestions

Signed-off-by: eduponz <[email protected]>

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

Signed-off-by: eduponz <[email protected]>

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

Signed-off-by: eduponz <[email protected]>

* Refs #20815: Add doxygen in DynamicLoanableSequence

Signed-off-by: eduponz <[email protected]>

* Refs #20815: Delete copy semantic from DynamicLoanableSequence

Signed-off-by: eduponz <[email protected]>

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

Signed-off-by: eduponz <[email protected]>

---------

Signed-off-by: eduponz <[email protected]>
(cherry picked from commit 9a64956)

Signed-off-by: eduponz <[email protected]>
@EduPonz EduPonz force-pushed the mergify/bp/2.13.x/pr-4876 branch from 45929f5 to 675590d Compare June 8, 2024 06:54
@EduPonz EduPonz requested a review from JesusPoderoso June 8, 2024 07:17
@EduPonz EduPonz removed the conflicts Backport PR wich git cherry pick failed label Jun 8, 2024
@EduPonz EduPonz requested review from JesusPoderoso and removed request for JesusPoderoso June 8, 2024 07:17
@github-actions github-actions bot added ci-pending PR which CI is running labels Jun 8, 2024
@EduPonz EduPonz force-pushed the mergify/bp/2.13.x/pr-4876 branch from 675590d to a9f60cd Compare June 8, 2024 07:53
@EduPonz EduPonz requested review from JesusPoderoso and removed request for JesusPoderoso June 8, 2024 07:53
JesusPoderoso
JesusPoderoso previously approved these changes Jun 10, 2024
Copy link
Contributor

@JesusPoderoso JesusPoderoso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with green CI

@JesusPoderoso
Copy link
Contributor

@richiprosima please test this

@JesusPoderoso JesusPoderoso 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 10, 2024
@JesusPoderoso JesusPoderoso force-pushed the mergify/bp/2.13.x/pr-4876 branch from a9f60cd to 0258c6c Compare June 10, 2024 14:35
@JesusPoderoso JesusPoderoso added no-test Skip CI tests if PR marked with this label and removed ready-to-merge Ready to be merged. CI and changes have been reviewed and approved. labels Jun 10, 2024
@JesusPoderoso
Copy link
Contributor

@richiprosima please test linux

@EduPonz EduPonz added ready-to-merge Ready to be merged. CI and changes have been reviewed and approved. and removed no-test Skip CI tests if PR marked with this label labels Jun 11, 2024
@EduPonz EduPonz merged commit 89ecf5b into 2.13.x Jun 11, 2024
4 checks passed
@EduPonz EduPonz deleted the mergify/bp/2.13.x/pr-4876 branch June 11, 2024 06:21
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