A word of warning if you are using MySQL as persistence service. I recently discovered that state changes of my persisted items were missing from the database. Digging into the cause of the problem, I believe it to be related to the fact that the “time resolution” in the MySQL server (prior to version 5.7) is only seconds. Since the Time column of the tables used to hold the historic states for an item is also the PRIMARY KEY (that needs to be unique) it appears that any state change within the time frame of one second from the previous is simply discarded!
I have raised an issue on github for this (#4546).
Anybody else seeing this behavior?