heubeck / samler

SaMLer - Smart Meter data collector at the edge
GNU General Public License v3.0
5 stars 3 forks source link

duplicate messaged send #11

Closed seehase closed 1 year ago

seehase commented 1 year ago

I have a unique indec on ident + time and got this error

Dec 11 19:36:21 raspberrypi run_samler.sh[454]: 2022/12/11 19:36:21 Ciruit closed
Dec 11 19:36:21 raspberrypi run_samler.sh[454]: 2022/12/11 19:36:21 Creating database schema
Dec 11 19:36:21 raspberrypi run_samler.sh[454]: 2022/12/11 19:36:21 Failed sending to MySQL Error 1062 (23000): Duplicate entry '2022-12-11 12:02:42-16.7.0' for key 'time_ident'
Dec 11 19:36:21 raspberrypi run_samler.sh[454]: 2022/12/11 19:36:21 Ciruit open
Dec 11 19:36:51 raspberrypi run_samler.sh[454]: 2022/12/11 19:36:51 Ciruit closed
Dec 11 19:36:51 raspberrypi run_samler.sh[454]: 2022/12/11 19:36:51 Creating database schema
Dec 11 19:36:51 raspberrypi run_samler.sh[454]: 2022/12/11 19:36:51 Failed sending to MySQL Error 1062 (23000): Duplicate entry '2022-12-11 12:02:42-16.7.0' for key 'time_ident'
Dec 11 19:36:51 raspberrypi run_samler.sh[454]: 2022/12/11 19:36:51 Ciruit open
heubeck commented 1 year ago

yeah. ident+time is not necessary unique. mysqls timestamp precision is seconds isn't it? if your sensor sends 2 measurements for the same ident in only one second this may happen. that's not a bug. Why have you chosen a unique index instead a normal one?

seehase commented 1 year ago

not relevant