[Backend/Edge] Make resend (backfill) work with a plain Timedata.InfluxDB - #11
Merged
Conversation
write(edgeId, ResendDataNotification) was an empty stub, so data replayed by an Edge after a reconnect (the rrd4j resend pipeline) was silently dropped and gaps were never filled. Persist it via the same writeData path as timestamped data. Signed-off-by: arindahills <arinda.hillary@gmail.com>
queryResendData silently dropped AVERAGE-consolidated channels (Voltage, Current, Frequency, ActivePower) from the backfill: the 'adjustSeconds = arcStep - 300' shift was 0 for the 300s AVERAGE archive, so the narrow (<=300s) resend window left rrd4j slots NaN or just outside the window and only cumulated (3600s) channels survived a reconnect. Read each channel at the archive matching its consolidation and native step (mirroring queryHistoricData), and coerce the rrd4j double back to the channel's OpenemsType so integer/boolean channels are written with the same field type as live data - otherwise a float-vs-integer field conflict makes the timeseries backend drop the whole resent point. Completes resend/backfill support for a plain Timedata.InfluxDB backend. Signed-off-by: arindahills <293051436+arindahills@users.noreply.github.com>
… a decimal gson JsonPrimitive#equals treats 100 and 100.0 as equal, so the value check did not actually verify the OpenemsType coercion. Assert the serialized form so the regression for the float-vs-integer InfluxDB field conflict is real. Signed-off-by: arindahills <293051436+arindahills@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Resend/backfill (gap-fill on Edge reconnect) doesn't work on a plain
Timedata.InfluxDBbackend: the InfluxDB provider had no resend write path, and the Edge's rrd4j resend produced AVERAGE channels whose field type didn't match InfluxDB's stored type (integer-vs-float conflict), so backfilled points were rejected.Like the aggregator-cache patch (OpenEMS#10), this lived out-of-tree in the NFE builds and was never in
main— so from-mainbuilds drop it. Second of the two open NFE PRs (upstream OpenEMS#3798), never reviewed.Fix (cherry-picked from OpenEMS#3798, 4 commits, applied clean onto
main)Timedata.InfluxDB: implement the resend (backfill) write path.Timedata.Rrd4j: resend AVERAGE channels at native step and coerce values to the channel'sOpenemsType, so integer channels serialise without a float/integer field conflict.Effect
Backfill after an Edge reconnect actually persists to InfluxDB. Completes the pair with OpenEMS#10 so the NFE fork
mainbuilds a fully-working backend + edge (no out-of-tree patches).🤖 Generated with Claude Code