| As observed at customer sites, the initial sync can still find itself in a deadlock with garbage collection. When this happens, PuppetDB remains in maintenance mode for 4 hours until restarted by systemd. The periodic sync is successfully cancelled by garbage collection, so we should use the same logic for initial sync to prevent the deadlock. But because we really do want the initial sync to run and complete, we also need to serialize the initial garbage collection with the initial sync. If startup sync does not complete before the next run of gc (after gc-interval), it could still be cancelled, but this will be a "best effort" until we can rework the summary query. |