Agent Client Collector policies are not synced to agents after MID restartDescriptionWhen a MID server restarts, the process for sending the policies and check instances is ran on the instance and sent to the MID server via a config_publish ECC queue message. The ECC queue payload contains policies and their check instances configured for agents that have been previously collected, regardless of connection status. The MID server currently has an issue where the policies and their check instances are not associated for tracking if the config_publish ECC queue message has been processed by the MID server before the offline agents reconnect. The information will be present in the policy tracking mechanism, but the flow that processes the message sent to an agent during keep alive processing will not contain the up-to-date policies and their check instances due to the missing associations. If this were to occur, the policies and check instances for the agent would not be updated until a full policy calculation has been performed either manually via a force sync or the regular scheduled job interval. This can result in checks not running for some time on select agents.Steps to Reproduce - Spin up a MID server and connect an agent- Add the sn_agent.verbose_logging_ids property with the agentId to the ecc_agent_property table to verify data using the MID server logs.- Make sure the agent is fully connected with attached policies (create a policy to sync down in needed or install ACC_M/L etc...)- Stop the MID server- Stop the agent- Start the MID server- Wait for the config_publish message to be sent to the MID via ECC queue- On the MID server record, invoke the "Grab Agent Client Collector Statistics" and view the JSON- Verify within the "connectedAgents" JSON section that the agent is NOT connected by searching for the agentId- Verify within the "policies" JSON section that the policy and check instances associated with the DOWN agent are present. The agentId should be present for the policies in question.- Verify within clientConfiguration that there isn't any record for the agentId- Start the agent- Verify in the log that the message "cannot add policy due to missing configuration:" for each policy associated with the agent is present due to the agent not being connected- Connect the agent- Wait 10 minutes and verify that the a schedule message is not sent to the agent due to no checksum change (there will be one message logged every minute during this time frame).WorkaroundTo remedy, identify the agents where the configured check count does not match the number of assigned checks in an agents related list. This mismatch indicates that there are unassociated checks in the schedule message generated by the MID server and sent to the agent for processing. For each agent identified, perform the following: Note the MID server the agent is connected toNavigate to the sn_agent_mid_info table and open the entry for the MID server in questionCheck the Force config sync box and update the recordFull policy calculation will be performed within the next minute interval for the action to registerVerify an ECC queue message for the MID server is generated in the ECC queue table on the MonitoringProbe topic with the name config_publish.Once the matching input record has been returned, verify the counts have been correctly updated in the agent client collector record.Related Problem: PRB1971767