Hi,
I turned on postgresql logging and tried to delete entire service, it
fails and rolls back, see below.
Thanks,
Eirik
===========
date; curl -i -u admin:admin -X DELETE -H 'X-Requested-By: ambari'
http://localhost:8080/api/v1/clusters/helm/services/STORM
Sun May 17 17:02:29 CEST 2015
HTTP/1.1 500 Transaction rolled back because transaction was set to
RollbackOnly.
Set-Cookie: AMBARISESSIONID=1a9unoldhj0p7a3rj3jik6cm;Path=/
Content-Type: text/plain;charset=ISO-8859-1
Content-Length: 104
Server: Jetty(7.6.7.v20120910)
{
"status": 500,
"message": "Transaction rolled back because transaction was set to
RollbackOnly."
===============
<2015-05-17 17:02:29 CEST - 5558ac05.14a6-1/1350> LOG: execute
<unnamed>: SELECT user_id, active, create_time, ldap_user, user_name,
user_password, principal_id FROM users WHERE ((LOWER(user_name) = $1)
AND (ldap_user = $2))
<2015-05-17 17:02:29 CEST - 5558ac05.14a6-1/1350> DETAIL: parameters:
$1 = 'admin', $2 = '0'
<2015-05-17 17:02:29 CEST - 5558ac05.14a6-1/1351> LOG: execute
<unnamed>: SELECT member_id, group_id, user_id FROM members WHERE
(user_id = $1)
<2015-05-17 17:02:29 CEST - 5558ac05.14a6-1/1351> DETAIL: parameters:
$1 = '1'
<2015-05-17 17:02:29 CEST - 5558ac05.14a6-1/1352> LOG: execute
<unnamed>: SELECT privilege_id, permission_id, principal_id, resource_id
FROM adminprivilege WHERE (principal_id IN ($1))
<2015-05-17 17:02:29 CEST - 5558ac05.14a6-1/1352> DETAIL: parameters:
$1 = '4'
<2015-05-17 17:02:29 CEST - 5558ac05.14a6-1/1353> LOG: execute
<unnamed>: BEGIN
<2015-05-17 17:02:29 CEST - 5558ac05.14a6-1/1353> LOG: execute
<unnamed>: DELETE FROM servicedesiredstate WHERE ((cluster_id = $1) AND
(service_name = $2))
<2015-05-17 17:02:29 CEST - 5558ac05.14a6-1/1353> DETAIL: parameters:
$1 = '2', $2 = 'STORM'
<2015-05-17 17:02:29 CEST - 5558ac05.14a6-1/1353> LOG: execute
<unnamed>: DELETE FROM clusterservices WHERE ((cluster_id = $1) AND
(service_name = $2))
<2015-05-17 17:02:29 CEST - 5558ac05.14a6-1/1353> DETAIL: parameters:
$1 = '2', $2 = 'STORM'
<2015-05-17 17:02:29 CEST - 5558ac05.14a6-1/1353> ERROR: update or
delete on table "clusterservices" violates foreign key constraint
"srvccmponentdesiredstatesrvcnm" on table "servicecomponentdesiredstate"
<2015-05-17 17:02:29 CEST - 5558ac05.14a6-1/1353> DETAIL: Key
(service_name,cluster_id)=(STORM,2) is still referenced from table
"servicecomponentdesiredstate".
<2015-05-17 17:02:29 CEST - 5558ac05.14a6-1/1353> STATEMENT: DELETE
FROM clusterservices WHERE ((cluster_id = $1) AND (service_name = $2))
<2015-05-17 17:02:29 CEST - 5558ac05.14a6-1/0> ERROR: current
transaction is aborted, commands ignored until end of transaction block
<2015-05-17 17:02:29 CEST - 5558ac05.14a6-1/0> STATEMENT: SELECT 1
<2015-05-17 17:02:29 CEST - 5558ac05.14a6-1/0> LOG: execute S_2: ROLLBACK