PuppetDB sync compares the contents of two databases and transfers over any data that isn't present in the local database. If a large amount of data is transferred, a large command queue will be created which has to be worked off. This can result in several sync cycles transferring the same data before the first copy reaches the front of the command queue and is inserted into the database.
PuppetDB sync should list the IDs of records in the queue at the beginning of sync and skip transferring any remote records that are included in the list.
This can lead to long sync times for customers which have a lot of data to sync. In those cases this causes the sync process to consume many more resource than it should. Such as database connections, CPU usage, network traffic, all to process sync data that is already sitting in the command queue waiting to get into the database.
Allow PupppetDB to take already enqueued commands into account when deciding which records need to by pulled from a remote PuppetDB during HA Sync. This fixes an issue where duplicate commands could be added to the command queue during sync, which could result in extra work and more downtime before the PuppetDB doing the sync could respond to new commands.