-
Notifications
You must be signed in to change notification settings - Fork 255
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
Reverse read order API and sqlite storage implementation #1083
Conversation
rosbag2_storage/include/rosbag2_storage/storage_interfaces/base_read_interface.hpp
Outdated
Show resolved
Hide resolved
API sweep to expose to Python revealed a larger surface area than I suspected - need to fix up the SequentialReader to be able to iterate backward between storage files, if necessary. Moving back to draft |
67d0d4a
to
05f171e
Compare
bb7138b
to
9b4cdcc
Compare
Ready to go but now depends on #1098 for the reverse timestamp split-bag test to work correctly |
d7abe6d
to
356495c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@emersonknapp Thanks for implementation and sorry for delay in review from my side.
It turns out a lot of changes in many files and I was need to check logic very carefully.
Please see my comments and suggestions inline.
rosbag2_cpp/include/rosbag2_cpp/reader_interfaces/base_reader_interface.hpp
Outdated
Show resolved
Hide resolved
rosbag2_cpp/include/rosbag2_cpp/reader_interfaces/base_reader_interface.hpp
Outdated
Show resolved
Hide resolved
rosbag2_storage_default_plugins/src/rosbag2_storage_default_plugins/sqlite/sqlite_storage.cpp
Outdated
Show resolved
Hide resolved
rosbag2_storage_default_plugins/src/rosbag2_storage_default_plugins/sqlite/sqlite_storage.cpp
Outdated
Show resolved
Hide resolved
rosbag2_storage_default_plugins/src/rosbag2_storage_default_plugins/sqlite/sqlite_storage.cpp
Outdated
Show resolved
Hide resolved
rosbag2_storage_default_plugins/src/rosbag2_storage_default_plugins/sqlite/sqlite_storage.cpp
Outdated
Show resolved
Hide resolved
rosbag2_transport/test/rosbag2_transport/mock_sequential_reader.hpp
Outdated
Show resolved
Hide resolved
356495c
to
167182a
Compare
Pulling the one last conversation out to main thread for visibility:
|
rosbag2_storage_default_plugins/src/rosbag2_storage_default_plugins/sqlite/sqlite_storage.cpp
Show resolved
Hide resolved
504dc40
to
606b2f7
Compare
Gist: https://gist.githubusercontent.com/emersonknapp/c5fded23fae98a4aafcf2a94672512a4/raw/ad0dd75e0b643a5c5f1a91b71dd5457352fc9d46/ros2.repos |
rosbag2_storage_default_plugins/src/rosbag2_storage_default_plugins/sqlite/sqlite_storage.cpp
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@emersonknapp
I found out that when we will have read order by file without reverse which is currently supported the seek(timestamp) will not really work and will reset our seek_row_id
which is unexpected.
I don't see a descent solution for this case. Therefore I would suggest to disable rosbag2_storage::ReadOrder::File
completely for sqlite_storage
implementation and create a follow up task to properly support it. It looks like that we will need to make some overhaul in sqlite_storage.cpp
and in logic related to how we preparing database for readout in different cases.
I have also concern that we are not really doing db readout on seek
and set_read_order
- it will complicate things if we will add more logic in those methods and someone would do set_read_order
then right after that seek
before reading out new message. However it will be Ok to have it as is currently is if will have only one sort by timestamp order.
ae1b36e
to
787f5e5
Compare
OK - I have disabled File order reading entirely |
Gist: https://gist.githubusercontent.com/emersonknapp/f4e47a0ee418ead1fcaeaa13f9330cbf/raw/ad0dd75e0b643a5c5f1a91b71dd5457352fc9d46/ros2.repos |
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
…reader tests Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
73a1750
to
6a76616
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tentatively approve.
I found out one printf
in tests I think this is residual from debug/development. It would be nice to remove it. It's trivial and minor I think we can omit rerunning CI if it will be removed.
I am more worry about appeared warnings on Windows build about YAML_CPP_DLL
redefinition. There are wasn't such warnings from previous CI run.
@emersonknapp Do you have any idea what caused those warnings on Windows build?
reader.close(); | ||
|
||
for (bool do_reset : {false, true}) { | ||
printf("Testing with do_reset %d\n", do_reset); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgotten debug printf
from yesterday?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, removing. Also yes, the windows warnings were from being slightly out of date - I will rebase and rerun.
@emersonknapp Ok It seems I know root cause of the warnings on Windows build. Could you please try to rebase your branch on top of latest rolling and re-run CI for Windows job? |
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
Gist: https://gist.githubusercontent.com/emersonknapp/4790ab890f1abc4f1c7d22fcb809ef0d/raw/ad0dd75e0b643a5c5f1a91b71dd5457352fc9d46/ros2.repos |
@emersonknapp Thanks for your hard work on this PR and sorry for long review process. |
No worries, sorry if I was brusque yesterday, I was feeling grumpy because I hadn't had any coffee. Thanks for holding a high standard for the code |
Add a new BaseReadInterface::set_read_order API, and implement it for the SqliteStorage.
Adds 2 new capabilities: reverse-timestamp reading, and file-order reading. Does not implement reverse-file-order reading.