Bug 1127864 - staypuft: HA host group removed from the deployment but not properly removed at the hostgroup level
Summary: staypuft: HA host group removed from the deployment but not properly removed ...
Keywords:
Status: CLOSED DUPLICATE of bug 1127297
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: rubygem-staypuft
Version: unspecified
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ga
: Installer
Assignee: Scott Seago
QA Contact: Omri Hochman
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-08-07 17:41 UTC by Dafna Ron
Modified: 2014-08-08 14:19 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-08-08 14:19:21 UTC


Attachments (Terms of Use)

Description Dafna Ron 2014-08-07 17:41:52 UTC
Description of problem:

after changing a host group from single to HA and than back to single when having a host assigned, we fail with an sql error. 
after that we end up with two host groups: HA which is properly attached to the host and an old one which was not properly removed at the hostgroup level. 
If we try to remove the host group, even after manually removing he host group from the host, we would fail with dependency issues. 

Version-Release number of selected component (if applicable):

ruby193-rubygem-staypuft-0.1.22-1.el6ost.noarch

How reproducible:

100%

Steps to Reproduce:
1. create a deployment and select "Controller / Compute" 
2. assign a host 
3. revisit the wizard 
4. change "Controller / Compute" to "High Availability Controllers / Compute" press next
5. press back and change "High Availability Controllers / Compute" to "Controller / Compute" press next (you should get an error)
6. try to remove the deployment (you should fail)
7. go to hosts -> manually remove the host group from the host 
8. try to remove the deployment 

Actual results:

we would keep failing to remove the deployment since we actually fail to remove the "Controller / Compute" properly

Expected results:

"Controller / Compute" should be properly removed. 

Additional info:

Ancestry::AncestryException
Cannot delete record because it has descendants.
ancestry (2.0.0) lib/ancestry/instance_methods.rb:61:in `apply_orphan_strategy'
activesupport (3.2.8) lib/active_support/callbacks.rb:495:in `_run__1470158764045703020__destroy__618872499202405223__callbacks'
activesupport (3.2.8) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.8) lib/active_support/callbacks.rb:385:in `_run_destroy_callbacks'
activesupport (3.2.8) lib/active_support/callbacks.rb:81:in `run_callbacks'
activerecord (3.2.8) lib/active_record/callbacks.rb:254:in `destroy'
activerecord (3.2.8) lib/active_record/transactions.rb:236:in `block in destroy'
activerecord (3.2.8) lib/active_record/transactions.rb:295:in `block in with_transaction_returning_status'
activerecord (3.2.8) lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
activerecord (3.2.8) lib/active_record/transactions.rb:208:in `transaction'
activerecord (3.2.8) lib/active_record/transactions.rb:293:in `with_transaction_returning_status'
activerecord (3.2.8) lib/active_record/transactions.rb:236:in `destroy'
activerecord (3.2.8) lib/active_record/associations/builder/belongs_to.rb:78:in `belongs_to_dependent_destroy_for_hostgroup'
activesupport (3.2.8) lib/active_support/callbacks.rb:427:in `_run__2119352762179617545__destroy__618872499202405223__callbacks'
activesupport (3.2.8) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.8) lib/active_support/callbacks.rb:385:in `_run_destroy_callbacks'
activesupport (3.2.8) lib/active_support/callbacks.rb:81:in `run_callbacks'
activerecord (3.2.8) lib/active_record/callbacks.rb:254:in `destroy'
activerecord (3.2.8) lib/active_record/transactions.rb:236:in `block in destroy'
activerecord (3.2.8) lib/active_record/transactions.rb:295:in `block in with_transaction_returning_status'
activerecord (3.2.8) lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
activerecord (3.2.8) lib/active_record/transactions.rb:208:in `transaction'
activerecord (3.2.8) lib/active_record/transactions.rb:293:in `with_transaction_returning_status'
activerecord (3.2.8) lib/active_record/transactions.rb:236:in `destroy'
staypuft (0.1.22) app/controllers/staypuft/deployments_controller.rb:65:in `destroy'
actionpack (3.2.8) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (3.2.8) lib/abstract_controller/base.rb:167:in `process_action'
actionpack (3.2.8) lib/action_controller/metal/rendering.rb:10:in `process_action'
actionpack (3.2.8) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
activesupport (3.2.8) lib/active_support/callbacks.rb:527:in `block (3 levels) in _run__130363524727507275__process_action__3848729324020486285__callbacks'
activesupport (3.2.8) lib/active_support/callbacks.rb:215:in `block in _conditional_callback_around_7386'
activesupport (3.2.8) lib/active_support/callbacks.rb:326:in `around'
activesupport (3.2.8) lib/active_support/callbacks.rb:310:in `_callback_around_910'
activesupport (3.2.8) lib/active_support/callbacks.rb:214:in `_conditional_callback_around_7386'
activesupport (3.2.8) lib/active_support/callbacks.rb:526:in `block (2 levels) in _run__130363524727507275__process_action__3848729324020486285__callbacks'
activesupport (3.2.8) lib/active_support/callbacks.rb:215:in `block in _conditional_callback_around_7385'
app/models/concerns/foreman/thread_session.rb:33:in `clear_thread'
activesupport (3.2.8) lib/active_support/callbacks.rb:214:in `_conditional_callback_around_7385'
activesupport (3.2.8) lib/active_support/callbacks.rb:415:in `block in _run__130363524727507275__process_action__3848729324020486285__callbacks'
activesupport (3.2.8) lib/active_support/callbacks.rb:215:in `block in _conditional_callback_around_7384'
activesupport (3.2.8) lib/active_support/callbacks.rb:326:in `around'
activesupport (3.2.8) lib/active_support/callbacks.rb:310:in `_callback_around_13'
activesupport (3.2.8) lib/active_support/callbacks.rb:214:in `_conditional_callback_around_7384'
activesupport (3.2.8) lib/active_support/callbacks.rb:414:in `_run__130363524727507275__process_action__3848729324020486285__callbacks'
activesupport (3.2.8) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.8) lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
activesupport (3.2.8) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.8) lib/abstract_controller/callbacks.rb:17:in `process_action'
actionpack (3.2.8) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (3.2.8) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
activesupport (3.2.8) lib/active_support/notifications.rb:123:in `block in instrument'
activesupport (3.2.8) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (3.2.8) lib/active_support/notifications.rb:123:in `instrument'
actionpack (3.2.8) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
actionpack (3.2.8) lib/action_controller/metal/params_wrapper.rb:207:in `process_action'
activerecord (3.2.8) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (3.2.8) lib/abstract_controller/base.rb:121:in `process'
actionpack (3.2.8) lib/abstract_controller/rendering.rb:45:in `process'
actionpack (3.2.8) lib/action_controller/metal.rb:203:in `dispatch'
actionpack (3.2.8) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
actionpack (3.2.8) lib/action_controller/metal.rb:246:in `block in action'
actionpack (3.2.8) lib/action_dispatch/routing/route_set.rb:73:in `call'
actionpack (3.2.8) lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
actionpack (3.2.8) lib/action_dispatch/routing/route_set.rb:36:in `call'
journey (1.0.4) lib/journey/router.rb:68:in `block in call'
journey (1.0.4) lib/journey/router.rb:56:in `each'
journey (1.0.4) lib/journey/router.rb:56:in `call'
actionpack (3.2.8) lib/action_dispatch/routing/route_set.rb:600:in `call'
apipie-rails (0.1.2) lib/apipie/static_dispatcher.rb:65:in `call'
actionpack (3.2.8) lib/action_dispatch/middleware/static.rb:62:in `call'
apipie-rails (0.1.2) lib/apipie/middleware/checksum_in_headers.rb:27:in `call'
actionpack (3.2.8) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
rack (1.4.1) lib/rack/etag.rb:23:in `call'
rack (1.4.1) lib/rack/conditionalget.rb:35:in `call'
actionpack (3.2.8) lib/action_dispatch/middleware/head.rb:14:in `call'
actionpack (3.2.8) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
lib/middleware/catch_json_parse_errors.rb:9:in `call'
actionpack (3.2.8) lib/action_dispatch/middleware/flash.rb:242:in `call'
rack (1.4.1) lib/rack/session/abstract/id.rb:205:in `context'
rack (1.4.1) lib/rack/session/abstract/id.rb:200:in `call'
actionpack (3.2.8) lib/action_dispatch/middleware/cookies.rb:339:in `call'
activerecord (3.2.8) lib/active_record/query_cache.rb:64:in `call'
activerecord (3.2.8) lib/active_record/connection_adapters/abstract/connection_pool.rb:473:in `call'
actionpack (3.2.8) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
activesupport (3.2.8) lib/active_support/callbacks.rb:405:in `_run__3052408847767462625__call__618872499202405223__callbacks'
activesupport (3.2.8) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.8) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
activesupport (3.2.8) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.8) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (3.2.8) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
actionpack (3.2.8) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
actionpack (3.2.8) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.8) lib/rails/rack/logger.rb:26:in `call_app'
railties (3.2.8) lib/rails/rack/logger.rb:16:in `call'
actionpack (3.2.8) lib/action_dispatch/middleware/request_id.rb:22:in `call'
rack (1.4.1) lib/rack/methodoverride.rb:21:in `call'
rack (1.4.1) lib/rack/runtime.rb:17:in `call'
activesupport (3.2.8) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.4.1) lib/rack/lock.rb:15:in `call'
actionpack (3.2.8) lib/action_dispatch/middleware/static.rb:62:in `call'
rack-cache (1.2) lib/rack/cache/context.rb:136:in `forward'
rack-cache (1.2) lib/rack/cache/context.rb:143:in `pass'
rack-cache (1.2) lib/rack/cache/context.rb:155:in `invalidate'
rack-cache (1.2) lib/rack/cache/context.rb:71:in `call!'
rack-cache (1.2) lib/rack/cache/context.rb:51:in `call'
railties (3.2.8) lib/rails/engine.rb:479:in `call'
railties (3.2.8) lib/rails/application.rb:223:in `call'
railties (3.2.8) lib/rails/railtie/configurable.rb:30:in `method_missing'
rack (1.4.1) lib/rack/builder.rb:134:in `call'
rack (1.4.1) lib/rack/urlmap.rb:64:in `block in call'
rack (1.4.1) lib/rack/urlmap.rb:49:in `each'
rack (1.4.1) lib/rack/urlmap.rb:49:in `call'
/usr/lib/ruby/gems/1.8/gems/passenger-4.0.18/lib/phusion_passenger/rack/thread_handler_extension.rb:77:in `process_request'
/usr/lib/ruby/gems/1.8/gems/passenger-4.0.18/lib/phusion_passenger/request_handler/thread_handler.rb:140:in `accept_and_process_next_request'
/usr/lib/ruby/gems/1.8/gems/passenger-4.0.18/lib/phusion_passenger/request_handler/thread_handler.rb:108:in `main_loop'
/usr/lib/ruby/gems/1.8/gems/passenger-4.0.18/lib/phusion_passenger/request_handler.rb:441:in `block (3 levels) in start_threads'

Comment 1 Scott Seago 2014-08-07 22:53:49 UTC
The basic issue is that when we change layout on a deployment, this requires creating and deleting hostgroups where the layouts differ (i.e. moving from non-HA to HA neutron, controller and networker are deleted, a new (different) controller hostgroup is added, but compute is unchanged; for HA neutron to nova, controller hostgroup remains, but compute is deleted and a new one is created).

If there's a host attached to a to-be-deleted hostgroup, the hostgroup isn't deleted as it should be, even though it's removed from the Deployment's list of hostgroups. This is what causes the error on later attempts to delete. If there are no hosts, the issue does not arise. The fix is to remove the hosts from the hostgroup prior to attempting deletion.

Comment 2 Mike Burns 2014-08-08 14:19:21 UTC

*** This bug has been marked as a duplicate of bug 1127297 ***


Note You need to log in before you can comment on or make changes to this bug.