Skip to content
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

[rrd4j] Fix restore on startup #18308

Merged
merged 1 commit into from
Feb 22, 2025
Merged

Conversation

mherwege
Copy link
Contributor

Closes #18303

With openhab/openhab-core#4463, the restoreOnStartup strategy not only restores the last state, but also the last state update, last state change and previous state. To achieve that, a default method was implemented that queries the DB and searches backwards for the last state change. That query does not have a start date, rather looks as far as it needs.

RRD4J does not allow a query with no start date. Therefore the default method is overriden in this PR to limit how far back in the history the query will look.

In general, mapdb is the more efficient storage to restore values on startup, allowing to retrieve all values for all item types.

@kaikreuzer FYI

Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
@mherwege mherwege requested a review from a team as a code owner February 21, 2025 15:53
@lsiepel lsiepel added bug An unexpected problem or unintended behavior of an add-on regression Regression that happened during the development of a release. Not shown on final release notes. labels Feb 21, 2025
Copy link
Member

@kaikreuzer kaikreuzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many thanks for the fix, @mherwege!

@kaikreuzer kaikreuzer merged commit 1cefae4 into openhab:main Feb 22, 2025
2 checks passed
@kaikreuzer kaikreuzer added this to the 5.0 milestone Feb 22, 2025
@mherwege mherwege deleted the rrd4j_restore branch February 22, 2025 15:24
matgroe pushed a commit to matgroe/openhab-addons that referenced this pull request Feb 24, 2025
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on regression Regression that happened during the development of a release. Not shown on final release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[rrd4j] Not able to restore values on startup
3 participants