Can I recover orphan records in MongoDB?

478
1
Jump to solution
05-18-2018 07:34 AM
ChrisMathers1
Occasional Contributor II

I had a couple servers where we updated the Windows version and Monitor quit trying to connect after 8 failed attempts. The connection wasn't able to reestablish after restarting the Monitor service,  BUG-000113723, so I exported my collection config, deleted the collection, and imported the exported config. Boom, problem solved. When I did though the clientId for the records is different for all new records and I cant see data in Monitor older than 5/4/18 when I did this. The older data is still there I think and the clientId is the only thing I can find that is different between the records which would explain me not being able to see the data. In auth.account in the MongoDB I have one account in which _id corresponds to the accountId given in the properties of the collection in Monitor Administrator and has an array of clients where the current clientId in the ArcGISMonitor.result and ArcGISMonitor.resultshour is the last entry in the array. The records in ArcGISMonitor.result only seem to go back to 5/4/18 but the records in ArcGISMonitor.resultshour go back to when we installed Monitor on 2/8/18. ArcGISMonitor.result has 5.1 million records and I cant believe those are all only from the last two weeks.

0 Kudos
1 Solution

Accepted Solutions
JohnGraham2
Occasional Contributor

Hi Chris,

When updating the Windows version or during other extended periods of non-connectivity, I suggest to click the "Stop Collection" button in the Administrator > System > servername > Config tab. This prevents the 8 consecutive failed attempts by ArcGIS Monitor to connect to the System and giving up. Another option is to set the sample interval to 1 hour for the System being updated, allowing upto 8 hours for it to attempt connecting again.  

 

Yes, importing the exported config creates a new unique clientId. After this point, all the new data will have this id to prevent duplicates and collisions with other data. After deleting the collection, the old clientId is no longer usable, so any records still left with that clientId are orphaned. If you had a full backup of the MongoDB and ArcGIS Monitor config files from the point before deleting the collection, the data and files could be restored to that point in time. In ArcGIS Monitor 10.6.1, we made a design change to remove the limit of 8 failed connection attempts. So as long as the ArcGIS Monitor Service <Name> is running, it will continue to attempt connections at the sample interval. If an items fails to collect, it will continue to be listed as monitoring failure until the connection and data collection is successful at the sample interval. The delete collection operation was also improved to clean up the old clientId.

View solution in original post

0 Kudos
1 Reply
JohnGraham2
Occasional Contributor

Hi Chris,

When updating the Windows version or during other extended periods of non-connectivity, I suggest to click the "Stop Collection" button in the Administrator > System > servername > Config tab. This prevents the 8 consecutive failed attempts by ArcGIS Monitor to connect to the System and giving up. Another option is to set the sample interval to 1 hour for the System being updated, allowing upto 8 hours for it to attempt connecting again.  

 

Yes, importing the exported config creates a new unique clientId. After this point, all the new data will have this id to prevent duplicates and collisions with other data. After deleting the collection, the old clientId is no longer usable, so any records still left with that clientId are orphaned. If you had a full backup of the MongoDB and ArcGIS Monitor config files from the point before deleting the collection, the data and files could be restored to that point in time. In ArcGIS Monitor 10.6.1, we made a design change to remove the limit of 8 failed connection attempts. So as long as the ArcGIS Monitor Service <Name> is running, it will continue to attempt connections at the sample interval. If an items fails to collect, it will continue to be listed as monitoring failure until the connection and data collection is successful at the sample interval. The delete collection operation was also improved to clean up the old clientId.

0 Kudos