-
Notifications
You must be signed in to change notification settings - Fork 248
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
Sqlite storage double buffering #546
Conversation
Current issues:
|
Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai>
Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai>
Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai>
Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai>
Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai>
Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai>
Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai>
Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai>
Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai>
Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai>
Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai>
Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai>
Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai>
Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai>
Note that cache size is now in bytes rather than number of messages, as of #530 - max_cache_size should probably be equivalent to the transaction size to start, unless you think they should be different? |
Yes, we are aware that We will update draft soon. |
Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai>
Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai>
Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai>
Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai>
47af55f
to
56dfb8d
Compare
Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai>
Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai>
…le_buffering Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai>
Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai>
Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai>
Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai>
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.
Quite some warnings on Windows, but pretty straightforward to address. We will handle them tomorrow. |
Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai>
Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai>
@Karsten1987 @mjeronimo, could you re-trigger Windows CI job? Otherwise this is ready to merge as far as I am concerned. Also, could you allow @pijaro to push branches to rosbag2? Would make it a bit easier for us. |
@adamdbrw - @Karsten1987 will have to add @pijaro; I'm not an owner of this repo and can't grant permissions. |
There are 9 warnings left. They don't look like they are associated with the PR changes though.. or am I wrong? |
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.
The same windows warnings are currently seen on the nightlies. So yes, there are unrelated.
@mjeronimo I'll leave it up to you to take a pass on this as well.
@adamdbrw I've also confirmed that all of the CMakeLists.txt warnings are also in the nightlies. However, there is one new warning related to the use of the std::accumulate template function from the <numeric> header:
Which, I believe, is referring to the usage here: The sizes of size_t and uint32_t are different (size_t == 8 bytes, while uint32_t == 4 bytes). I think you can get rid of this one with some slight modifications to the code to use the appropriate types for the accumulation. |
Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai>
@mjeronimo: final warning should be fixed now |
Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai>
Performance of master vs this PR: Note that both old and new default for cache ( |
Seems like the numeric warning is gone and only cmake (unrelated) ones remain. Are we good to merge this? |
Yes, just confirmed with the latest build that all CMake warnings are also in the nightly build and that the warning is gone. Merging. |
Woohoo! Thanks everyone for pushing this through - it looks great, this is a huge improvement for rosbag2. |
Are there any plans to backport it to Foxy? |
* Double buffers Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Circular queue and FLUSH option as define Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Minor naming and lexical fixes. Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Removed FLUSH_BUFFERS define check. Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Sqlite3 storage logging fixes. Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Sqlite3 storage circular buffer with pre allocated memory. Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Sqlite3 storage buffers moved to shared_ptrs. Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Uncrustify Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Moved double buffers to writer Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Buffer layer reset in seq compression writer in rosbag2 cpp Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Buffer layer for rosbag2 writer refactor Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Changed buffers in BufferLayer to std vectors. Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * BufferLayer uncrustify Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Removed non-applicable test for writer cache. Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * BufferLayer review fixes Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Rosbag metadata msgs count fixed for BufferLayer Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Condition variable for buffer layer sync. Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Fixed buffer locks Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Buffers in BufferLayer refactored, moved into new class Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Buffer layer split bags fixed. Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Storage options include fix in buffer layer header. Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Mutex around swapping buffers in buffer layer. Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Fixed cache 0 bug in buffer layer. Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Minor buffer layer refactor. Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Counting messages in writer refactored. Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Changed default cache size to 100Mb and updated parameter description Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> * Applied review remarks: - significant refactoring: separation of cache classes - applied suggested improvements - some renaming - reduce code duplication that would otherwise increase with cache refactor, between compression and plain writers Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> * Applied review comments - cache consumer now takes a callback and is independent of storage - namespace changes, renaming, cleaning - counting and logging messages by topic Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> * linter Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> * Changes after review: fixing flushing, topic counts, and more Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> * Fix for splitting - flushing state now correctly turns off Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> * cache classes documentation Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> * simplified signature Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> * a couple of tests for cache Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> * address review: explicit constructor and doxygen styling Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> * Windows warnings fix Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> * fixed type mismatch warning on Windows Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> * added minor comment Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> Co-authored-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai>
It's not certain yet - the code has diverged significantly in API-breaking ways from the Foxy release that will make it hard to backport this on its own. We're having an active conversation now to potentially backport all of the latest rosbag2 code to Foxy, but this is in its early stages. |
* Double buffers Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Circular queue and FLUSH option as define Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Minor naming and lexical fixes. Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Removed FLUSH_BUFFERS define check. Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Sqlite3 storage logging fixes. Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Sqlite3 storage circular buffer with pre allocated memory. Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Sqlite3 storage buffers moved to shared_ptrs. Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Uncrustify Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Moved double buffers to writer Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Buffer layer reset in seq compression writer in rosbag2 cpp Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Buffer layer for rosbag2 writer refactor Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Changed buffers in BufferLayer to std vectors. Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * BufferLayer uncrustify Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Removed non-applicable test for writer cache. Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * BufferLayer review fixes Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Rosbag metadata msgs count fixed for BufferLayer Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Condition variable for buffer layer sync. Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Fixed buffer locks Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Buffers in BufferLayer refactored, moved into new class Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Buffer layer split bags fixed. Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Storage options include fix in buffer layer header. Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Mutex around swapping buffers in buffer layer. Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Fixed cache 0 bug in buffer layer. Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Minor buffer layer refactor. Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Counting messages in writer refactored. Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Changed default cache size to 100Mb and updated parameter description Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> * Applied review remarks: - significant refactoring: separation of cache classes - applied suggested improvements - some renaming - reduce code duplication that would otherwise increase with cache refactor, between compression and plain writers Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> * Applied review comments - cache consumer now takes a callback and is independent of storage - namespace changes, renaming, cleaning - counting and logging messages by topic Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> * linter Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> * Changes after review: fixing flushing, topic counts, and more Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> * Fix for splitting - flushing state now correctly turns off Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> * cache classes documentation Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> * simplified signature Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> * a couple of tests for cache Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> * address review: explicit constructor and doxygen styling Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> * Windows warnings fix Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> * fixed type mismatch warning on Windows Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> * added minor comment Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> Co-authored-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> Signed-off-by: Emerson Knapp <eknapp@amazon.com>
* Double buffers Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Circular queue and FLUSH option as define Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Minor naming and lexical fixes. Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Removed FLUSH_BUFFERS define check. Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Sqlite3 storage logging fixes. Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Sqlite3 storage circular buffer with pre allocated memory. Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Sqlite3 storage buffers moved to shared_ptrs. Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Uncrustify Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Moved double buffers to writer Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Buffer layer reset in seq compression writer in rosbag2 cpp Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Buffer layer for rosbag2 writer refactor Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Changed buffers in BufferLayer to std vectors. Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * BufferLayer uncrustify Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Removed non-applicable test for writer cache. Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * BufferLayer review fixes Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Rosbag metadata msgs count fixed for BufferLayer Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Condition variable for buffer layer sync. Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Fixed buffer locks Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Buffers in BufferLayer refactored, moved into new class Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Buffer layer split bags fixed. Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Storage options include fix in buffer layer header. Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Mutex around swapping buffers in buffer layer. Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Fixed cache 0 bug in buffer layer. Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Minor buffer layer refactor. Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Counting messages in writer refactored. Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai> * Changed default cache size to 100Mb and updated parameter description Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> * Applied review remarks: - significant refactoring: separation of cache classes - applied suggested improvements - some renaming - reduce code duplication that would otherwise increase with cache refactor, between compression and plain writers Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> * Applied review comments - cache consumer now takes a callback and is independent of storage - namespace changes, renaming, cleaning - counting and logging messages by topic Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> * linter Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> * Changes after review: fixing flushing, topic counts, and more Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> * Fix for splitting - flushing state now correctly turns off Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> * cache classes documentation Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> * simplified signature Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> * a couple of tests for cache Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> * address review: explicit constructor and doxygen styling Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> * Windows warnings fix Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> * fixed type mismatch warning on Windows Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> * added minor comment Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> Co-authored-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai>
Ongoing work on implementation for #436