When removing a service, the configurations for that service are kept for historical purposes, but their various associations in the database are removed (specifically, the serviceconfigmapping relationships).
After removing a service, the orphaned configurations now cause a warning to be displayed on Ambari Server startup:
These orphaned configurations have entries in both clusterconfig and clusterconfigmapping but are otherwise not references anywhere. They don't hurt anything, but do trigger this warning since we can't determine if they should have mappings in serviceconfigmapping.
A few options:
- When removing a service, remove configurations as well, leaving no orphans. Some would argue that this is a bad move since re-adding the service later would allow you to see the old configurations. I do not believe this is true since the old configurations are never associated with the new service's serviceconfig or serviceconfigmapping.
- Make the warning smarter somehow to ignore these since it's expected they are orphaned.
- Somehow determine the service which should own the config and see if it exists in the cluster?
- Add a new column to clusterconfig to mark it as deleted?
To clean these warnings, we had to:
I've considered advanced heuristics based on service metainfo with config dependencies, and service config mappings. But this approach may be unreliable when given inaccurate service metainfo between stack upgrades. Also, this approach is likely to delay server start on clusters with thousands of configs.
So the solution Add a new column to clusterconfig to mark it as deleted. So warning will not be generated for such cluster configs.