history Adapter deletes data before the retention time expires
reutli opened this issue · 9 comments
retention time is set to 2 years.
This morning adapter deleted data of 2021-04-26, so data which is exactly one year old.
It seems retention policy 'two years' is not correctly interpreted.
log:
2022-04-27 04:55:10.387 info Delete old history dir "/opt/iobroker/iobroker-data/history/20210426"
This data should have been not deleted not before 2023-04-26.
Please go to Admin, enable export mdoe, got to "Objects", open system.adapter.history.0 and click on the pencil icon. Then in the "Raw json data" tab please check the json and post the "retention" value from the native section of the JSON (or post fiull json).
Thank you
And please provide which history version is used.
history adapter V.1.11.
"native": { "maxLength": 960, "limit": 2000, "storeDir": "", "debounce": 1000, "retention": 31536000, "storeFrom": false, "storeAck": true, "changesRelogInterval": 0, "changesMinDelta": 0, "writeNulls": true
this morning again deletions:
`
history.0 | 2022-04-28 04:55:10.483 | info | Delete old history dir "/opt/iobroker/iobroker-data/history/20210427" |
---|---|---|---|
history.0 | 2022-04-28 04:55:10.483 | info | Delete old history "/opt/iobroker/iobroker-data/history/20210427/history.fronius.0.powerflow.P_PV.json" |
history.0 | 2022-04-28 04:55:10.478 | info | Delete old history "/opt/iobroker/iobroker-data/history/20210427/history.fronius.0.powerflow.P_Akku.json" |
history.0 | 2022-04-28 04:45:10.477 | info | Delete old history "/opt/iobroker/iobroker-data/history/20210427/history.fronius.0.powerflow.P_Load.json" |
history.0 | 2022-04-28 04:45:10.467 | info | Delete old history "/opt/iobroker/iobroker-data/history/20210427/history.fronius.0.powerflow.P_Grid.json" |
history.0 | 2022-04-28 04:40:34.992 | info | Delete old history "/opt/iobroker/iobroker-data/history/20210427/history.BYD_Batterie_Ladezustand.json" |
`
I thought the retention which is used is that one from the specific object. In system.adapter.history.0 you see the predefined user retention, but each object can have its own.
system.adapter.history.0 is set to "retention": "259200" (3 days) for me, but some objects has "retention": "63072000" which is 2 years. And for them the history complete exists for the whole 2 years.
@reutli "retention": 31536000 are 1 year. So what is your specific retentrion for e.g. "fronius.0.powerflow.P_PV"?
Exactly, the posted value is one year ...
Just to be sure we talks from the same:
- You have DEFAULT settings in the adapter config - these come into effect when you newly add a datapoint - this default is 1 year for your settings!
- per datapoint in the custom settings you then choose the real value for this datapoint ...
Ok, got it, therefore some questions from me:
- I've set the standard retention to two years in GUI, so why is one year shown in the system.adapter.history.0 ("retention": 31536000)?
- "per datapoint in the custom settings you then choose the real value for this datapoint ..." - exactly, that was my fault!!!
- is there a way to get a list of all objects in iobroker where history is set, to be sure
a) only the needed dp are saved
b) to check all the datapoint/objects
@reutli 3. On the top right corner you click on the wrench icon and choose history.
With 1.11.1 it works for me. Just changed my default retention from 3 days to 2 years and now I have "retention": 63072000, in system.adapter.history.0
I think I found (my) fault:
After altering retention to "3 Monate"... ->
I've looked for "retention" in system.adapter.history = '31536000' = one year
But, I've to look in the right instance: system.adapter.history.0 = '7948800' = three months
how embarrassing by me :o(
Thx! - will close issue