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
read yaml config file #497
Conversation
5cdac32
to
2219919
Compare
3cc07d3
to
ffca12e
Compare
this is rebased on top of the latest changes in #493 |
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.
This looks good - a few stylistic notes if you want to take them
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_wrapper.cpp
Outdated
Show resolved
Hide resolved
rosbag2_storage_default_plugins/src/rosbag2_storage_default_plugins/sqlite/sqlite_storage.cpp
Show resolved
Hide resolved
In terms of testing - perhaps querying if the pragma is set would suffice?
should return the current value of the specific pragma setting. |
@Karsten1987 I would like to suggest some changes as well as discuss overall design. I don't have access rights to comment or push changes to the branch. How do we proceed?
Meanwhile, I will work on it locally |
ffca12e
to
3d86a14
Compare
@adamdbrw you should have write access now to this repo. Feel free to simply push ontop of this branch. I've rebased and hopefully addressed Emerson's comments. |
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.
lgtm
rosbag2_storage_default_plugins/src/rosbag2_storage_default_plugins/sqlite/sqlite_storage.cpp
Outdated
Show resolved
Hide resolved
446d339
to
dbc311a
Compare
As I am documenting the use of storage configuration parameter, I am struggling to find a good example of a useful If not, I would change the Also, we should decide on the default values for |
I think that |
I agree with this, it's more flexible to allow for future use cases |
ac0447d
to
e32edbb
Compare
I had to force push to fix DCO issues
Also, added some documentation earlier (could be more difficult to notice because of force pushes). |
This change seems unrelated to your PR and should not happen. I don't appreciate changing history of committers not participating in this PR. |
@Karsten1987 I assumed I was only reversing what happened as a side effect during a rebase I performed, since the original change was merged in already. Is there a suggestion how to handle this at this moment? |
You should be able to solve your problem with a proper rebase on master with no merges. One way to get the history quite clean, if you don't care about any intermediate history on this PR, is to just |
Signed-off-by: Karsten Knese <karsten@openrobotics.org>
Signed-off-by: Karsten Knese <Karsten1987@users.noreply.github.com>
- includes documentation of storage-config-file option - includes adaptation of benchmarking script to cache size semantic change - tests with valid and invalid storage file Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai>
4aba1a8
to
6e1fd86
Compare
@emersonknapp thanks for the tip, I used your approach but also cherry-picked @Karsten1987 commits so we have contributions properly attributed. Now, this should be much better - I preserved authorship of commits and at the same time merged all mine into what looks to me like a proper, targeted change. Let me know if this looks good to you. I am looking into Windows build unstability - it seems that opening with a valid storage config file throws an exception. One place to look at is this line in |
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.
rosbag2_storage_default_plugins/src/rosbag2_storage_default_plugins/sqlite/sqlite_wrapper.cpp
Outdated
Show resolved
Hide resolved
{"journal_mode", pragma_assign + "WAL"}, | ||
{"synchronous", pragma_assign + "NORMAL"} |
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.
I am not sure how we decided on the default values in the end, but that's the non-optimized pragmas, right? Have we hereby decided that these are the default values?
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.
If I recall correctly, we decided to change the defaults in a separate PR (along with changing the default split size to something else than 0 and including information about possible consequences). I can also add this change to current PR, doesn't make a difference to me. Let me know what is better.
rosbag2_storage_default_plugins/src/rosbag2_storage_default_plugins/sqlite/sqlite_wrapper.cpp
Outdated
Show resolved
Hide resolved
Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai>
I've inspected windows issues with Dirty workaround is to change tests order (move the test whith |
- change pragma tests order as a workaround to fix tests issue on Windows: exception throwing tests don't clean temp folders Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai>
This should also pass Windows tests now |
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.
rosbag2_storage_default_plugins/src/rosbag2_storage_default_plugins/sqlite/sqlite_wrapper.cpp
Outdated
Show resolved
Hide resolved
Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai>
@Karsten1987: With all review remarks applied, are we good to merge this now? |
This looks good to me. Thanks for iterating with me. Just fyi, I can't formerly approve this PR as it's actually still opened under my name, but I just believe that @emersonknapp's approval still counts ;-) CI for completness: |
* read yaml config file Signed-off-by: Karsten Knese <karsten@openrobotics.org> * address review comments Signed-off-by: Karsten Knese <Karsten1987@users.noreply.github.com> * Sqlite storage pragmas handling and validation - includes documentation of storage-config-file option - includes adaptation of benchmarking script to cache size semantic change - tests with valid and invalid storage file Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> * Applied review remarks Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> * - Typo fix - change pragma tests order as a workaround to fix tests issue on Windows: exception throwing tests don't clean temp folders Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> * Applied review: moved some parsing and key extraction to parse function Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> Co-authored-by: Adam Dabrowski <adam.dabrowski@robotec.ai>
* read yaml config file Signed-off-by: Karsten Knese <karsten@openrobotics.org> * address review comments Signed-off-by: Karsten Knese <Karsten1987@users.noreply.github.com> * Sqlite storage pragmas handling and validation - includes documentation of storage-config-file option - includes adaptation of benchmarking script to cache size semantic change - tests with valid and invalid storage file Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> * Applied review remarks Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> * - Typo fix - change pragma tests order as a workaround to fix tests issue on Windows: exception throwing tests don't clean temp folders Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> * Applied review: moved some parsing and key extraction to parse function Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> Co-authored-by: Adam Dabrowski <adam.dabrowski@robotec.ai> Signed-off-by: Emerson Knapp <eknapp@amazon.com>
implements to read a config file (
.yaml
) tailored for sqlite3. As for now, I've only implemented to read pragmas in the style of:I am struggling a bit to write tests for this as I have a hard time to introspect if these pragmas are actually affective. I can't really test for wrong pragmas either as according to the sqlite documentation "No error messages are generated if an unknown pragma is issued."