Trend sqlth_scinfo and sqlth_drv table duplicates added every x months

I seem to run into this issue every few months on a particular site, where they will suddenly lose visibility of all trend data. Adding an x-trace will show the trace in the far left of the chart and the date 1/1/1970.

When I look in the sqlth_scinfo table, I then see additional rows now with multiple rows for the same scnames, and multiple of the same provider in the sqlth_drv table:

image
image

I used to be able to fix this by changing the drvid in the scinfo table to the latest in the drv table, but this doesn’t seem to work anymore… I also noticed that now I have a new “system” provider, so I tried adding a tag from the system provider, and this does show the trend data now, even back months ago…
I have a lot of trends scattered throughout the project though and don’t want a have to update every single tag path to use [/.system]tag/path instead of tag/path or [~]tag/path.

Not sure how to diagnose this one!

Edit: this time, changing the drvid’s in the sqlth_scinfo table all to 4 (i.e. the latest drvid, excluding the ‘system’ provider). This is what I updated the table to, and now trend data is working correctly… Still want to get to the bottom of why it keeps destroying itself?

image