trove resize-volume for postgresql doesn't work, because its guest agent's stop_db def implementation doesn't have do_not_start_on_reboot optional argument

Bug #1410425 reported by Nirav Shah
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack DBaaS (Trove)
Fix Released
High
Nirav Shah

Bug Description

With 'trove resize-volume <id>' for postgresql guest agent, I see:

2015-01-10 02:13:16.685 21358 ERROR trove.guestagent.api [req-a12066a0-4341-4c78-8662-daf43a722b09 1297a95379fa4a529dc5cefe3a533d6f 42a4899821eb4624b542589b8f3c154f - - -] Error calling stop_db
2015-01-10 02:13:16.685 21358 TRACE trove.guestagent.api Traceback (most recent call last):
2015-01-10 02:13:16.685 21358 TRACE trove.guestagent.api File "/usr/lib/python2.7/dist-packages/trove/guestagent/api.py", line 53, in _call
2015-01-10 02:13:16.685 21358 TRACE trove.guestagent.api timeout=timeout_sec)
2015-01-10 02:13:16.685 21358 TRACE trove.guestagent.api File "/usr/lib/python2.7/dist-packages/trove/openstack/common/rpc/proxy.py", line 126, in
call
2015-01-10 02:13:16.685 21358 TRACE trove.guestagent.api result = rpc.call(context, real_topic, msg, timeout)
2015-01-10 02:13:16.685 21358 TRACE trove.guestagent.api File "/usr/lib/python2.7/dist-packages/trove/openstack/common/rpc/__init__.py", line 139,
in call
2015-01-10 02:13:16.685 21358 TRACE trove.guestagent.api return _get_impl().call(CONF, context, topic, msg, timeout)
2015-01-10 02:13:16.685 21358 TRACE trove.guestagent.api File "/usr/lib/python2.7/dist-packages/trove/openstack/common/rpc/impl_kombu.py", line 815, in call
2015-01-10 02:13:16.685 21358 TRACE trove.guestagent.api rpc_amqp.get_connection_pool(conf, Connection))
2015-01-10 02:13:16.685 21358 TRACE trove.guestagent.api File "/usr/lib/python2.7/dist-packages/trove/openstack/common/rpc/amqp.py", line 553, in call
2015-01-10 02:13:16.685 21358 TRACE trove.guestagent.api rv = list(rv)
2015-01-10 02:13:16.685 21358 TRACE trove.guestagent.api File "/usr/lib/python2.7/dist-packages/trove/openstack/common/rpc/amqp.py", line 518, in __iter__
2015-01-10 02:13:16.685 21358 TRACE trove.guestagent.api raise result
2015-01-10 02:13:16.685 21358 TRACE trove.guestagent.api TypeError: stop_db() got an unexpected keyword argument 'do_not_start_on_reboot'
2015-01-10 02:13:16.685 21358 TRACE trove.guestagent.api Traceback (most recent call last):
2015-01-10 02:13:16.685 21358 TRACE trove.guestagent.api
2015-01-10 02:13:16.685 21358 TRACE trove.guestagent.api File "/usr/lib/python2.7/dist-packages/trove/openstack/common/rpc/amqp.py", line 440, in _process_data
2015-01-10 02:13:16.685 21358 TRACE trove.guestagent.api **args)
2015-01-10 02:13:16.685 21358 TRACE trove.guestagent.api
2015-01-10 02:13:16.685 21358 TRACE trove.guestagent.api File "/usr/lib/python2.7/dist-packages/trove/openstack/common/rpc/dispatcher.py", line 172, in dispatch
2015-01-10 02:13:16.685 21358 TRACE trove.guestagent.api result = getattr(proxyobj, method)(ctxt, **kwargs)
2015-01-10 02:13:16.685 21358 TRACE trove.guestagent.api
2015-01-10 02:13:16.685 21358 TRACE trove.guestagent.api TypeError: stop_db() got an unexpected keyword argument 'do_not_start_on_reboot'
2015-01-10 02:13:16.685 21358 TRACE trove.guestagent.api
2015-01-10 02:13:16.685 21358 TRACE trove.guestagent.api

This is because stop_db definition in guestagent/datastore/postgresql/service/process.py doesn't have an optional argument of do_not_start_on_reboot.

    def stop_db(self, context):

It should be similar to mysql's service.py implementation of stop_db:

    def stop_db(self, update_db=False, do_not_start_on_reboot=False):

Revision history for this message
Denis M. (dmakogon) wrote :

Sound like a good catch. Unfortunately it's our fault because we don't have good test coverage for postgresql.

I will try int-tests for postgresql and will see if they are broken. But, any way, this is a real problem, thanks for pointing it out.

Revision history for this message
Denis M. (dmakogon) wrote :
Changed in trove:
importance: Undecided → High
status: New → Confirmed
milestone: none → kilo-2
Nirav Shah (nirav)
Changed in trove:
assignee: nobody → Nirav Shah (nirav)
Changed in trove:
status: Confirmed → In Progress
Changed in trove:
milestone: kilo-2 → kilo-3
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to trove (master)

Reviewed: https://review.openstack.org/149501
Committed: https://git.openstack.org/cgit/openstack/trove/commit/?id=69773141dd194a9c06685b86e2e88fd78d0bd314
Submitter: Jenkins
Branch: master

commit 69773141dd194a9c06685b86e2e88fd78d0bd314
Author: Nirav Shah <email address hidden>
Date: Thu Jan 22 21:31:24 2015 -0800

    Fix PostgreSQL volume definitions

    Add support for resize-volume.
    Currently, resize-volume (in models.py) calls guest instance's stop_db, via
    _assert_datastore_is_offline. This stop_db definition requires a keyword
    argument do_not_start_on_reboot. This patch corrects stop_db
    implementation, which originally didn't have do_not_start_on_reboot
    keyword argument.
    This patch also implements mount_volume, unmount_volume, and resize_fs.
    It also implements _enable_pgsql_on_boot and _disable_pgsql_on_boot.
    These definitions are required to fix 1410425 (resize-volume bug
    in postgresql).
    The easiest way to verify this bug (and this patch) is to follow
    these steps:
    - trove create ps1 100 --datastore postgresql --datastore_version
      9.3 --size 1 --databases db1 --users user1:password1
    - trove list (note the ID, and verify instance is active)
    - trove resize-volume <id> 2
    - trove list (verify that size is 2)

    Closes-Bug: #1410425
    Change-Id: Ifc245dbf27af0269a2b71995bc2c6e2733420a81

Changed in trove:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in trove:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in trove:
milestone: kilo-3 → 2015.1.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.