Hi, Lukas and all!
While giving an error to rediscovered managed host is obviously better than creating a duplicate, I still think this is not exactly a correct thing to do. As we discussed last year [1], current state machine needs to be enhanced to provide more than 2 states of the machine - managed and discovered. Otherwise, if provisioned system happen to crash and pxeboot (because it has lost its bootdisk or raid controller, for example), it’ll be in a limbo state - it won’t show up in discovered hosts as it has been already discovered, yet there won’t any indication of it being booted with discover image.
IMHO, when this happens, some kind of flag needs to be raised for that managed host to indicate its true state - “unexpected FDI boot” or something like that. With such flag in place, people can report/dashboard on such hosts for further corrective actions w/o having manually to go through each of hosts that have failed to send puppet report.
1 - Lots of "Mysql2::Error: Deadlock found when trying to get lock" under increased load
Just my 2 cents.