[ https://issues.apache.org/jira/browse/KNOX-2947?focusedWorklogId=876111&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-876111 ]
ASF GitHub Bot logged work on KNOX-2947: ---------------------------------------- Author: ASF GitHub Bot Created on: 14/Aug/23 11:16 Start Date: 14/Aug/23 11:16 Worklog Time Spent: 10m Work Description: zeroflag opened a new pull request, #783: URL: https://github.com/apache/knox/pull/783 ## What changes were proposed in this pull request? Validating if shared provider is used by a descriptor before deleting it via hadoop xml resource monitor. ## How was this patch tested? Enabling monitor: ```xml <property> <name>gateway.cloudera.manager.descriptors.monitor.interval</name> <value>5000</value> </property> ``` hxr file ```xml <configuration> <property> <name>topology3</name> <value> discoveryType=ClouderaManager# discoveryAddress=http://host:123# discoveryUser=user# discoveryPasswordAlias=alias# cluster=Cluster 1# providerConfigRef=used# app:knoxauth:param1.name=param1.value# app:admin-ui# HIVE:url=http://localhost:456# HIVE:version=1.0# HIVE:httpclient.connectionTimeout=5m# HIVE:httpclient.socketTimeout=100m </value> </property> <property> <name>providerConfigs:used,unused</name> <value>remove</value> </property> </configuration> ``` Observed log messages: ``` 2023-08-14 13:08:50,085 WARN knox.gateway (HadoopXmlResourceParserResult.java:check(54)) - Not deleting provider used as it is referenced by on ore more descriptors. 2023-08-14 13:08:50,111 INFO knox.gateway (HadoopXmlResourceMonitor.java:processDeleted(120)) - Deleting file /Users/attilamagyar/development/test/conf/shared-providers/unused.json ``` Issue Time Tracking ------------------- Worklog Id: (was: 876111) Remaining Estimate: 0h Time Spent: 10m > Deleting provider via hadoop xml resource should check if the provider is > used by a descriptor > ---------------------------------------------------------------------------------------------- > > Key: KNOX-2947 > URL: https://issues.apache.org/jira/browse/KNOX-2947 > Project: Apache Knox > Issue Type: Bug > Reporter: Attila Magyar > Assignee: Attila Magyar > Priority: Major > Time Spent: 10m > Remaining Estimate: 0h > > When deleting a shared provider by using the "delete" keyword in a hxr file > we currently don't check if the provider is referenced by a descriptor. > Instead of deleting, we should emit a warning message. -- This message was sent by Atlassian Jira (v8.20.10#820010)