-
Notifications
You must be signed in to change notification settings - Fork 770
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
[14921] Lose message since WriterProxy::changes_from_writer_low_mark_ is used in StatefulReader::begin_sample_access_nts() #2760
Comments
About solution, whether Fast-DDS/src/cpp/rtps/reader/StatefulReader.cpp Lines 1140 to 1159 in 7124ff8
|
@Barry-Xu-2018 I have several questions on this:
|
Yes.
Depth is 1.
Yes. I add log at here
Output: |
What you are seeing is expected behavior. Let me try to explain it. Using KEEP_LAST with depth=1 means that, for each instance (i.e. for each different key), only the last sample is kept in the history. Then, when calling I guess that the sequence numbers shown on your debug output correspond to different instances, and they are removed because they are being returned to the user on a |
Thanks for your explanation. I modified Subscriber log without log --- sub.log |
@Barry-Xu-2018 Again. I do not see any unexpected behavior. As we explain on the documentation, you can see the topic as a single DB table, where each instance is a row. The samples taken from the DataReader are subsequent updates to one or more rows. When there are several samples ready to be taken (which is what you are seeing on If what you're trying to achieve is to receive the samples in exactly the same order in which they are added to the DataWriter, that is the purpose of the PRESENTATION QoS ordered_access flag. This is, unfortunately, not currently implemented on Fast DDS. If using keys on your topic is not a hard requirement, you could change to a non-keyed topic and increase the depth field on the HISTORY QoS. |
Yes. The order of message with different key cannot be guaranteed. |
@Barry-Xu-2018 As See my changes over your branch for a solution |
Thank you for your support. |
I have another question.
Test code is located at https://github.com/Barry-Xu-2018/Fast-DDS/tree/topic-order-issues-with-key-topic. |
@Barry-Xu-2018 NotifyChanges is just finishing the loop to keep the consistency of the WriterProxy. We have a refactor of this on the roadmap so that NotifyChanges will call a new method on the RTPSReaderListener, so we can notify all changes at the same time. This way, we will get rid of that loop. |
eProsima#2760 Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
#2760 Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
Is there an already existing issue for this?
Expected behavior
No message loss
Current behavior
Some messages loss
Steps to reproduce
This can be reproduced by our codes. But I cannot paste these codes.
So I will describe found the problem based on my debug log output.
QoS setting:
At first, StatefulReader::change_received() receive messages (sequence number from 21 to 346 in turn). At this time, WriterProxy::changes_from_writer_low_mark_ is 0 and these sequence numbers are added to WriterProxy::changes_received_.
Then, a message with sequence number 1 is received. WriterProxy::changes_from_writer_low_mark_ is increased to 1. And WriterProxy::NotifyChanges() is called to send notification. ReadTakeCommand::add_instance() is called to take a message and remove taken message.
From sequence number 1 to 19, the process works well.
While receiving a message with sequence number 20, the problem occurs.
In StatefulReader::change_received(), WriterProxy::received_change_set() is called
Fast-DDS/src/cpp/rtps/reader/StatefulReader.cpp
Lines 909 to 912 in 7124ff8
After receiving a message with sequence number 19, changes_from_writer_low_mark_ is 19 and the sequence number of current message is 20. So execute below code
Fast-DDS/src/cpp/rtps/reader/WriterProxy.cpp
Lines 283 to 287 in 7124ff8
The problem occurs at cleanup()
Fast-DDS/src/cpp/rtps/reader/WriterProxy.cpp
Lines 397 to 410 in 7124ff8
At this time, changes_received_ include sequence number from 21 to 346.
So changes_from_writer_low_mark_ will be increased from 20 to 346.
While taking message by ReadTakeCommand::add_instance(), StatefulReader::begin_sample_access_nts() is used to check if this message is future message based on
changes_from_writer_low_mark_
which is gotten by WriterProxy::available_changes_max();Fast-DDS/src/cpp/fastdds/subscriber/DataReaderImpl/ReadTakeCommand.hpp
Line 122 in 7124ff8
Since
changes_from_writer_low_mark_
is big (346), message is always taken and removed. Note that we want to take message with sequence number 21, but it will take a message with other sequence number and remove it.Fast DDS version/commit
v2.6.0
Platform/Architecture
Ubuntu Focal 20.04 amd64
Transport layer
Default configuration, UDPv4 & SHM
Additional context
No response
XML configuration file
No response
Relevant log output
No response
Network traffic capture
No response
The text was updated successfully, but these errors were encountered: