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

Merged
merged 3 commits into from
Jun 10, 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.10.x/pr-4876
Your branch is up to date with 'origin/2.10.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 <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)

# Conflicts:
#	src/cpp/rtps/reader/StatefulReader.cpp
#	src/cpp/rtps/reader/StatelessReader.cpp
#	test/unittest/statistics/dds/CMakeLists.txt
Signed-off-by: eduponz <eduardoponz@eprosima.com>
@EduPonz EduPonz force-pushed the mergify/bp/2.10.x/pr-4876 branch from c9b6ae9 to 8c0754e Compare June 8, 2024 07:16
@EduPonz EduPonz removed the conflicts Backport PR wich git cherry pick failed label Jun 8, 2024
@EduPonz EduPonz requested a review from MiguelCompany June 8, 2024 07:18
@github-actions github-actions bot added ci-pending PR which CI is running labels Jun 8, 2024
EduPonz added 2 commits June 8, 2024 09:50
…d functions

Signed-off-by: eduponz <eduardoponz@eprosima.com>
Signed-off-by: eduponz <eduardoponz@eprosima.com>
@EduPonz EduPonz force-pushed the mergify/bp/2.10.x/pr-4876 branch from 8c0754e to fe5cabf Compare June 8, 2024 07:50
@EduPonz EduPonz requested review from MiguelCompany and removed request for MiguelCompany June 8, 2024 12:04
@MiguelCompany
Copy link
Member

@richiprosima Please test windows and test discovery-server

@MiguelCompany MiguelCompany merged commit 0fcad67 into 2.10.x Jun 10, 2024
12 of 15 checks passed
@MiguelCompany MiguelCompany deleted the mergify/bp/2.10.x/pr-4876 branch June 10, 2024 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-pending PR which CI is running
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants