Bug 981528 - Can not reload postgresql-8.4/postgresql-9.2 after stopping DB cartridge with non-scablable app
Summary: Can not reload postgresql-8.4/postgresql-9.2 after stopping DB cartridge with...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Containers
Version: 2.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Hiro Asari
QA Contact: libra bugs
URL:
Whiteboard:
Depends On: 981780
Blocks: 980739 1010846
TreeView+ depends on / blocked
 
Reported: 2013-07-05 04:48 UTC by Wei Sun
Modified: 2015-05-14 23:23 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1010846 (view as bug list)
Environment:
Last Closed: 2013-07-22 15:21:29 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Wei Sun 2013-07-05 04:48:12 UTC
Description of problem:
After stopping postgresql-8.4/postgresql-9.2 cartridge,tried to reload them,but it failed.It returned some error messages,like
Unable to complete the requested operation due to: Failed to correctly execute all parallel operations

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

How reproducible:
Always

Steps to Reproduce:
1.Create an application 
2.Add postgresql-8.4/postgresql-9.2
3.Stop postgresql-8.4/postgresql-9.2
4.Reload postgresql-8.4/postgresql-9.2

Actual results:
openshift@openshift-ubuntu:~$ rhc reload-cartridge postgresql-9.2 -a eapt
Unable to complete the requested operation due to: Failed to correctly execute all parallel operations - --DEBUG--
Failed to execute: 'control reload' for /var/lib/openshift/41d9221ce51e11e28abc22000aa43651/postgresql

pg_ctl: PID file "/var/lib/openshift/41d9221ce51e11e28abc22000aa43651/postgresql/data/postmaster.pid" does not exist
Is server running?

--RESULT--

--MESSAGE--

--ERROR--

--APP INFO--

--CART COMMANDS--

--CART PROPERTIES--
{}
--DATA--

--EXIT CODE--
1
--USER ACTIONABLE--
false
.
Reference ID: cd54f321c881dcadfcccd1ad019eaaf6


Expected results:
openshift@openshift-ubuntu:~$ rhc reload-cartridge postgresql-9.2 -a eapt
RESULT:
postgresql-9.2 reloaded


Additional info:
If db cartridge is started,can reload the db cartridge

Comment 1 Yan Du 2013-07-05 06:01:30 UTC
it is ok with scalable app

[root@Daphne test]# rhc cartridge stop -a j2s -c postgresql-9.2
RESULT:
postgresql-9.2 stopped

[root@Daphne test]# rhc cartridge reload -a j2s -c postgresql-9.2
RESULT:
postgresql-9.2 reloaded

Comment 2 Hiro Asari 2013-07-05 19:29:43 UTC
The fact that the scalable app case returns the "success" message is actually a bug in CLI. (See https://bugzilla.redhat.com/show_bug.cgi?id=981780)

Comment 3 Hiro Asari 2013-07-05 19:32:49 UTC
'pg_ctl reload' will fail when postgresql is not running, so we need to avoid doing that. This is addressed by https://github.com/openshift/origin-server/pull/2993.

However, the PR won't address this bug entirely, since due to a couple of issues indicated above.

Comment 4 openshift-github-bot 2013-07-05 20:01:41 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/ee8816e280c1aeead2351943cce7b8d2e3884f06
Bug 981528

PostgreSQL can reload the config only when it's running.

Comment 5 Hiro Asari 2013-07-09 21:36:27 UTC
*** Bug 979442 has been marked as a duplicate of this bug. ***

Comment 6 openshift-github-bot 2013-07-10 14:04:32 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/3273645be4a4455e733f629369a933a12a127c76
Bug 981528

When the cartridge is down, it will be sent 'force-reload', not
'reload'.
Respond to that, and communicate with the user that it is invalid.

Use client_result for now, so that the user can see the message

See https://bugzilla.redhat.com/show_bug.cgi?id=981780

Comment 7 Hiro Asari 2013-07-10 17:25:59 UTC
bx bin/rhc app create rack ruby-1.9 postgresql-9.2
bx bin/rhc cartridge stop postgresql-9.2 -a rack
bx bin/rhc cartridge reload postgresql-9.2 -a rack


bx bin/rhc app stop postgresql-9.2 -a rack
bx bin/rhc cartridge reload postgresql-9.2 -a rack

both 'reload' should result in:

$ bx bin/rhc cartridge reload postgresql-9.2 -a rack
Reloading postgresql-9.2 ... done

'reload' is valid only when the database is running

Comment 8 Hiro Asari 2013-07-10 17:27:13 UTC
https://github.com/openshift/origin-server/pull/3042 should do this for good.

Comment 9 openshift-github-bot 2013-07-10 18:35:51 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/187bae81024adcb4bd53b7334bc126152b7626d3
Bug 981528

reload/force-reload depends on application status, so both can be sent
to the cartridge

Comment 10 Wei Sun 2013-07-11 02:56:22 UTC
Verified on INT(devenv_3481)

Result:
1.for postgresql-8.4
[sunwei@dhcp-8-229 ~]$ rhc stop-cartridge postgresql-8.4 -a perlt
Stopping postgresql-8.4 ... done
[sunwei@dhcp-8-229 ~]$ rhc reload-cartridge postgresql-8.4 -a perlt
Reloading postgresql-8.4 ... done

'reload' is valid only when the database is running
[sunwei@dhcp-8-229 ~]$ rhc status-cartridge postgresql-8.4 -a perlt
RESULT:
Postgres is stopped

2.for postgresql-9.2
[sunwei@dhcp-8-229 ~]$ rhc stop-cartridge postgresql-9.2 -a perlt
Stopping postgresql-9.2 ... done
[sunwei@dhcp-8-229 ~]$ rhc status-cartridge postgresql-9.2 -a perlt
RESULT:
Postgres is stopped
[sunwei@dhcp-8-229 ~]$ rhc reload-cartridge postgresql-9.2 -a perlt
Reloading postgresql-9.2 ... done

'reload' is valid only when the database is running
[sunwei@dhcp-8-229 ~]$ rhc status-cartridge postgresql-9.2 -a perlt
RESULT:
Postgres is stopped


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