-
Notifications
You must be signed in to change notification settings - Fork 144
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
[history] Allow using :memory: db to avoid disk writes. #664
Conversation
☔ The latest upstream changes (presumably 2b32f55) made this pull request unmergeable. Please resolve the merge conflicts. |
d766aa9
to
eb4c3bc
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.
Still need to test this patch in rpm-ostree, but yeah this definitely looks cleaner! 👍
libdnf/dnf-context.cpp
Outdated
@@ -229,6 +230,7 @@ dnf_context_init(DnfContext *context) | |||
priv->check_transaction = TRUE; | |||
priv->enable_filelists = TRUE; | |||
priv->zchunk = TRUE; | |||
priv->write_history = FALSE; |
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 should default to TRUE
, no? Otherwise, we're regressing everywhere other than rpm-ostree.
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.
Yeah, we should be defaulting to TRUE
here.
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.
ACK, changed to TRUE.
Yup, this is working fine here. |
libdnf/transaction/Swdb.cpp
Outdated
// check if DB file is present | ||
if (!pathExists(path.c_str())) { | ||
else if (!pathExists(path.c_str())) { |
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.
Minor: this formatting looks odd to me. Let's just put it on the same line as the previous closing brace?
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 tweaked the comments a little bit, it's hopefully better now.
☎️, can we get this in? |
@dmach Mind fixing this up so we can get it in? |
eb4c3bc
to
d952bcd
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.
Just minor tweaks otherwise LGTM!
libdnf/dnf-context.cpp
Outdated
* dnf_context_get_write_history | ||
* @context: a #DnfContext instance. | ||
* | ||
* Gets whether writing to history database is enabled |
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.
Minor/optional: missing final period
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.
fixed
libdnf/dnf-context.cpp
Outdated
* | ||
* Returns: %TRUE if writing to history database is enabled | ||
* | ||
* Since: 0.25.0 |
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 and below should be 0.27.0 now it seems?
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.
One small thing, otherwise LGTM!
libdnf/dnf-context.cpp
Outdated
* | ||
* Enables or disables writing to history database. | ||
* | ||
* Since: 0.25.0 |
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.
Just bump this version to match what it should be...
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.
fixed
New context methods to enable/disable history writes: dnf_context_get_write_history() dnf_context_set_write_history() When set to false, history gets written into an in-memory database rather than on disk.
d952bcd
to
84c4f00
Compare
LGTM |
📌 Commit 84c4f00 has been approved by |
☀️ Test successful - status-papr |
New context methods to enable/disable history writes:
dnf_context_get_write_history()
dnf_context_set_write_history()
When set to false, history gets written into
an in-memory database rather than on disk.