Skip to content

Conversation

@cferreiragonz
Copy link
Contributor

@cferreiragonz cferreiragonz commented Apr 14, 2025

Description

This PR aims to improve efficiency of DS routines by reducing the number of messages sent (Data(p), Data(r) and Data(w)). It does so by:

  • Avoiding re-sending the server's Data(p) to relevant participants every time its own Data(p) is added to the pdp_queue (when a new client is discovered). Now a direct message to the new discovered client is sent instead of adding the server's Data(p) to the queue, which led to multiple sends to all direct clients.
  • Sending just one Data(p) and Data(r/w) to direct clients by considering a three-state value (unmatched, sent & matched) for DiscoveryParticipantsAckStatus instead of just a boolean. In this way the Discovery DB avoids re-sending repeated data when processing topics.

Related PR:

@Mergifyio backport 3.1.x 2.14.x 2.10.x

Contributor Checklist

  • Commit messages follow the project guidelines.
  • The code follows the style guidelines of this project.
  • N/A 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
  • N/A 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.
  • If this is a critical bug fix, backports to the critical-only supported branches have been requested.
  • Check CI results: changes do not issue any warning.
  • Check CI results: failing tests are unrelated with the changes.

@cferreiragonz cferreiragonz marked this pull request as ready for review April 14, 2025 11:04
@cferreiragonz cferreiragonz requested review from richiprosima and removed request for richiprosima April 14, 2025 11:04
@github-actions github-actions bot added the ci-pending PR which CI is running label Apr 14, 2025
@cferreiragonz cferreiragonz force-pushed the improve_ds_routines branch 2 times, most recently from f2e1bb7 to f88e09d Compare April 14, 2025 14:52
@cferreiragonz cferreiragonz requested review from richiprosima and removed request for richiprosima April 14, 2025 14:53
@cferreiragonz cferreiragonz force-pushed the improve_ds_routines branch 2 times, most recently from 39c54a8 to 35784d6 Compare April 15, 2025 07:05
@cferreiragonz cferreiragonz requested review from richiprosima and removed request for richiprosima April 15, 2025 07:06
@cferreiragonz cferreiragonz changed the title [22814] Improve ds routines [22814] Improve DS routines Apr 15, 2025
@cferreiragonz cferreiragonz added needs-review PR that is ready to be reviewed and removed ci-pending PR which CI is running labels Apr 15, 2025
Copy link
Contributor

@Mario-DL Mario-DL left a comment

Choose a reason for hiding this comment

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

The approach looks good to me.
Apart from the suggestions below it would be nice if we could add a test. We can make use of test_UDPTransport to detect that the Data(P,W,R) are only sent one time.

@Mario-DL Mario-DL removed the needs-review PR that is ready to be reviewed label Apr 21, 2025
Signed-off-by: cferreiragonz <[email protected]>
@cferreiragonz
Copy link
Contributor Author

In spite of the changes requested, I have added as first two commits the tests to check each scenario solved by this PR.

Signed-off-by: cferreiragonz <[email protected]>
@cferreiragonz cferreiragonz requested a review from Mario-DL April 23, 2025 12:32
@github-actions github-actions bot added the ci-pending PR which CI is running label Apr 23, 2025
@rsanchez15 rsanchez15 added this to the v3.2.2 milestone Apr 24, 2025
Copy link
Contributor

@Mario-DL Mario-DL left a comment

Choose a reason for hiding this comment

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

LGTM,
Please double check the contributor checklist. I think we could backport this improvement

@cferreiragonz
Copy link
Contributor Author

@Mergifyio backport 3.1.x 2.14.x 2.10.x

@mergify
Copy link
Contributor

mergify bot commented Apr 24, 2025

backport 3.1.x 2.14.x 2.10.x

✅ Backports have been created

Details

@cferreiragonz cferreiragonz 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 Apr 24, 2025
@cferreiragonz cferreiragonz merged commit 0fa7b1e into master Apr 25, 2025
17 checks passed
@cferreiragonz cferreiragonz deleted the improve_ds_routines branch April 25, 2025 06:08
mergify bot pushed a commit that referenced this pull request Apr 25, 2025
* Refs #22814: Data(p) test

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

* Refs #22814: Data(r/w) test

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

* Refs #22814: Tristate for ParticipantsAckStatus

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

* Refs #22814: Send direct messages to new clients

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

* Refs #22814: Review - Changes

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

* Refs #22814: Uncrustify

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

---------

Signed-off-by: cferreiragonz <[email protected]>
(cherry picked from commit 0fa7b1e)
mergify bot pushed a commit that referenced this pull request Apr 25, 2025
* Refs #22814: Data(p) test

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

* Refs #22814: Data(r/w) test

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

* Refs #22814: Tristate for ParticipantsAckStatus

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

* Refs #22814: Send direct messages to new clients

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

* Refs #22814: Review - Changes

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

* Refs #22814: Uncrustify

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

---------

Signed-off-by: cferreiragonz <[email protected]>
(cherry picked from commit 0fa7b1e)

# Conflicts:
#	src/cpp/rtps/builtin/discovery/database/DiscoveryDataBase.cpp
#	src/cpp/rtps/builtin/discovery/database/DiscoveryDataBase.hpp
#	src/cpp/rtps/builtin/discovery/database/DiscoveryParticipantsAckStatus.cpp
#	src/cpp/rtps/builtin/discovery/database/DiscoveryParticipantsAckStatus.hpp
#	src/cpp/rtps/builtin/discovery/database/DiscoverySharedInfo.hpp
#	src/cpp/rtps/builtin/discovery/participant/PDPServer.cpp
mergify bot pushed a commit that referenced this pull request Apr 25, 2025
* Refs #22814: Data(p) test

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

* Refs #22814: Data(r/w) test

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

* Refs #22814: Tristate for ParticipantsAckStatus

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

* Refs #22814: Send direct messages to new clients

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

* Refs #22814: Review - Changes

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

* Refs #22814: Uncrustify

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

---------

Signed-off-by: cferreiragonz <[email protected]>
(cherry picked from commit 0fa7b1e)

# Conflicts:
#	src/cpp/rtps/builtin/discovery/database/DiscoveryDataBase.cpp
#	src/cpp/rtps/builtin/discovery/database/DiscoveryDataBase.hpp
#	src/cpp/rtps/builtin/discovery/database/DiscoveryParticipantsAckStatus.cpp
#	src/cpp/rtps/builtin/discovery/database/DiscoveryParticipantsAckStatus.hpp
#	src/cpp/rtps/builtin/discovery/database/DiscoverySharedInfo.hpp
#	src/cpp/rtps/builtin/discovery/participant/PDPServer.cpp
#	test/blackbox/common/BlackboxTestsDiscovery.cpp
Mario-DL pushed a commit that referenced this pull request May 13, 2025
* Refs #22814: Data(p) test

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

* Refs #22814: Data(r/w) test

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

* Refs #22814: Tristate for ParticipantsAckStatus

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

* Refs #22814: Send direct messages to new clients

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

* Refs #22814: Review - Changes

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

* Refs #22814: Uncrustify

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

---------

Signed-off-by: cferreiragonz <[email protected]>
(cherry picked from commit 0fa7b1e)
Mario-DL added a commit that referenced this pull request May 14, 2025
* Improve DS routines (#5764)

* Refs #22814: Data(p) test

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

* Refs #22814: Data(r/w) test

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

* Refs #22814: Tristate for ParticipantsAckStatus

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

* Refs #22814: Send direct messages to new clients

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

* Refs #22814: Review - Changes

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

* Refs #22814: Uncrustify

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

---------

Signed-off-by: cferreiragonz <[email protected]>
(cherry picked from commit 0fa7b1e)

* Fix pdata guid access to 3.1.x

Signed-off-by: Mario Dominguez <[email protected]>

---------

Signed-off-by: cferreiragonz <[email protected]>
Signed-off-by: Mario Dominguez <[email protected]>
Co-authored-by: Carlos Ferreira González <[email protected]>
Co-authored-by: Mario Dominguez <[email protected]>
EugenioCollado pushed a commit that referenced this pull request Jun 30, 2025
* Refs #22814: Data(p) test

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

* Refs #22814: Data(r/w) test

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

* Refs #22814: Tristate for ParticipantsAckStatus

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

* Refs #22814: Send direct messages to new clients

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

* Refs #22814: Review - Changes

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

* Refs #22814: Uncrustify

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

---------

Signed-off-by: cferreiragonz <[email protected]>
Signed-off-by: Eugenio Collado <[email protected]>
cferreiragonz added a commit that referenced this pull request Jul 22, 2025
* Refs #22814: Data(p) test

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

* Refs #22814: Data(r/w) test

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

* Refs #22814: Tristate for ParticipantsAckStatus

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

* Refs #22814: Send direct messages to new clients

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

* Refs #22814: Review - Changes

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

* Refs #22814: Uncrustify

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

---------

Signed-off-by: cferreiragonz <[email protected]>
Signed-off-by: Eugenio Collado <[email protected]>
cferreiragonz added a commit that referenced this pull request Jul 24, 2025
* Improve DS routines (#5764)

* Refs #22814: Data(p) test

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

* Refs #22814: Data(r/w) test

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

* Refs #22814: Tristate for ParticipantsAckStatus

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

* Refs #22814: Send direct messages to new clients

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

* Refs #22814: Review - Changes

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

* Refs #22814: Uncrustify

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

---------

Signed-off-by: cferreiragonz <[email protected]>
Signed-off-by: Eugenio Collado <[email protected]>

* Fix tests compilation

Signed-off-by: Eugenio Collado <[email protected]>

* Add GUID prefix and builtin data filter

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

* Avoid using parametrized test struct

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

* Move test to DDS suite

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

---------

Signed-off-by: cferreiragonz <[email protected]>
Signed-off-by: Eugenio Collado <[email protected]>
Co-authored-by: Carlos Ferreira González <[email protected]>
Co-authored-by: Eugenio Collado <[email protected]>
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.

4 participants