[Backend/Edge] Make resend (backfill) work with a plain Timedata.InfluxDB#3798
Open
arindahills wants to merge 4 commits into
Open
[Backend/Edge] Make resend (backfill) work with a plain Timedata.InfluxDB#3798arindahills wants to merge 4 commits into
arindahills wants to merge 4 commits into
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>
arindahills
force-pushed
the
pr/influx-resend-backfill
branch
from
June 30, 2026 21:03
f32e8d9 to
41b9f0a
Compare
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>
Contributor
|
@sfeilmeier Could you please help review this PR when you have a moment? It makes resend/backfill work with a plain Timedata.InfluxDB setup: Backend writes ResendDataNotification data, and Edge RRD4J resend reads AVERAGE channels with the correct serialized field types. |
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.
Backfill of historic data after a reconnect did not work end-to-end with a plain
Timedata.InfluxDBbackend (onlyAggregatedInfluxhandled it). Two independent gaps, fixed here:Backend
Timedata.InfluxDBdid not implement theResendDataNotificationwrite, so resent data was silently ignored. Implemented it to write resent points at their original timestamps, mirroring the timestamped write.Edge
Timedata.Rrd4j.queryResendDatasilently dropped AVERAGE-consolidated channels (Voltage, Current, Frequency, ActivePower): theadjustSeconds = arcStep - 300shift is 0 for the 300s AVERAGE archive, so the narrow (<=300s) resend window left slots NaN or just outside the window and only cumulated (3600s) channels survived. Now reads each channel at the archive matching its consolidation and native step (mirroringqueryHistoricData), and coerces the rrd4j double back to the channel'sOpenemsTypeso integer/boolean channels are written with the same field type as live data (otherwise a float-vs-integer field conflict makes InfluxDB drop the whole resent point).Verified on Backend 2026.6.0 + a real Edge over a controlled reconnect: Voltage, Current, Frequency and Energy backfill into the gap at 5-minute resolution with correct types and no field-type conflicts.