Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 148657 Details for
Bug 229650
Restart only the failed resource and its dependencies instead of the whole service.
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patch that will not handle the special flag discussed in comments #1 and #2.
rgmanager-cvs-recover_only_failed_resources-v01.patch (text/plain), 5.48 KB, created by
Simone Gotti
on 2007-02-23 10:06:21 UTC
(
hide
)
Description:
Patch that will not handle the special flag discussed in comments #1 and #2.
Filename:
MIME Type:
Creator:
Simone Gotti
Created:
2007-02-23 10:06:21 UTC
Size:
5.48 KB
patch
obsolete
>Index: src/daemons/restree.c >=================================================================== >RCS file: /cvs/cluster/cluster/rgmanager/src/daemons/restree.c,v >retrieving revision 1.25 >diff -u -p -r1.25 restree.c >--- src/daemons/restree.c 22 Feb 2007 16:37:28 -0000 1.25 >+++ src/daemons/restree.c 23 Feb 2007 09:53:42 -0000 >@@ -1010,7 +1010,7 @@ _res_op(resource_node_t **tree, resource > } > } > >- /* Start starts before children */ >+ /* Start/status starts before children */ > if (me && (op == RS_START)) { > node->rn_flags &= ~RF_NEEDSTART; > >@@ -1030,8 +1030,15 @@ _res_op(resource_node_t **tree, resource > } else if (me && (op == RS_STATUS)) { > /* Check status before children*/ > rv = do_status(node); >- if (rv != 0) >+ if (rv != 0) { >+ /* This resource needs a condstop and a >+ * condstart as it returned and error during >+ * its status check >+ */ >+ node->rn_flags |= RF_NEEDSTOP; >+ node->rn_flags |= RF_NEEDSTART; > return rv; >+ } > } > > >Index: src/daemons/rg_state.c >=================================================================== >RCS file: /cvs/cluster/cluster/rgmanager/src/daemons/rg_state.c,v >retrieving revision 1.28 >diff -u -p -r1.28 rg_state.c >--- src/daemons/rg_state.c 20 Feb 2007 19:54:42 -0000 1.28 >+++ src/daemons/rg_state.c 23 Feb 2007 09:53:44 -0000 >@@ -713,7 +713,7 @@ svc_advise_start(rg_state_t *svcStatus, > * @return FAIL, 0 > */ > int >-svc_start(char *svcName, int req) >+_svc_start(char *svcName, int req, int condstart) > { > struct dlm_lksb lockp; > int ret; >@@ -770,7 +770,11 @@ svc_start(char *svcName, int req) > > rg_unlock(&lockp); > >- ret = group_op(svcName, RG_START); >+ if (condstart) >+ ret = group_op(svcName, RG_CONDSTART); >+ else >+ ret = group_op(svcName, RG_START); >+ > ret = !!ret; /* Either it worked or it didn't. Ignore all the > cute values scripts might return */ > >@@ -804,6 +808,18 @@ svc_start(char *svcName, int req) > return ret; > } > >+int >+svc_start(char *svcName, int req) >+{ >+ return _svc_start(svcName, req, 0); >+} >+ >+int >+svc_condstart(char *svcName, int req) >+{ >+ return _svc_start(svcName, req, 1); >+} >+ > > /** > * Migrate a service to another node. >@@ -950,7 +966,7 @@ svc_status(char *svcName) > * @return FAIL, 0 > */ > static int >-_svc_stop(char *svcName, int req, int recover, uint32_t newstate) >+_svc_stop(char *svcName, int req, int recover, int condstop, uint32_t newstate) > { > struct dlm_lksb lockp; > rg_state_t svcStatus; >@@ -1014,7 +1030,11 @@ _svc_stop(char *svcName, int req, int re > } > rg_unlock(&lockp); > >- ret = group_op(svcName, RG_STOP); >+ if (condstop) >+ /* To recover a resource stop only from the failed childs and not the whole RG */ >+ ret = group_op(svcName, RG_CONDSTOP); >+ else >+ ret = group_op(svcName, RG_STOP); > > if (old_state == RG_STATE_FAILED && newstate == RG_STATE_DISABLED) { > if (ret) >@@ -1098,14 +1118,21 @@ _svc_stop_finish(char *svcName, int fail > int > svc_disable(char *svcName) > { >- return _svc_stop(svcName, RG_DISABLE, 0, RG_STATE_DISABLED); >+ return _svc_stop(svcName, RG_DISABLE, 0, 0, RG_STATE_DISABLED); > } > > > int > svc_stop(char *svcName, int req) > { >- return _svc_stop(svcName, req, (req == RG_STOP_RECOVER), >+ return _svc_stop(svcName, req, (req == RG_STOP_RECOVER), 0, >+ RG_STATE_STOPPED); >+} >+ >+int >+svc_condstop(char *svcName, int req) >+{ >+ return _svc_stop(svcName, req, (req == RG_STOP_RECOVER), 1, > RG_STATE_STOPPED); > } > >@@ -1295,7 +1322,7 @@ handle_relocate_req(char *svcName, int r > * Stop the service - if we haven't already done so. > */ > if (request != RG_START_RECOVER) { >- ret = _svc_stop(svcName, request, 0, RG_STATE_STOPPED); >+ ret = _svc_stop(svcName, request, 0, 0, RG_STATE_STOPPED); > if (ret == RG_EFAIL) { > svc_fail(svcName); > return RG_EFAIL; >@@ -1486,7 +1513,10 @@ handle_start_req(char *svcName, int req, > * This is a 'root' start request. We need to clear out our failure > * mask here - so that we can try all nodes if necessary. > */ >- ret = svc_start(svcName, req); >+ if (req == RG_START_RECOVER) >+ ret = svc_condstart(svcName, req); >+ else >+ ret = svc_start(svcName, req); > > /* > If services are locked, return the error >@@ -1603,9 +1633,19 @@ int > handle_recover_req(char *svcName, int *new_owner) > { > char policy[20]; >+ int ret; > > get_recovery_policy(svcName, policy, sizeof(policy)); > >+ if ((!strcasecmp(policy, "disable")) || (!strcasecmp(policy, "relocate"))) { >+ /* Try to stop the service */ >+ if ((ret = svc_stop(svcName, RG_STOP_RECOVER)) != 0) >+ return ret; >+ } else { >+ if ((ret = svc_condstop(svcName, RG_STOP_RECOVER)) != 0) >+ return ret; >+ } >+ > if (!strcasecmp(policy, "disable")) { > return svc_disable(svcName); > } else if (!strcasecmp(policy, "relocate")) { >Index: src/daemons/rg_thread.c >=================================================================== >RCS file: /cvs/cluster/cluster/rgmanager/src/daemons/rg_thread.c,v >retrieving revision 1.17 >diff -u -p -r1.17 rg_thread.c >--- src/daemons/rg_thread.c 14 Dec 2006 20:11:04 -0000 1.17 >+++ src/daemons/rg_thread.c 23 Feb 2007 09:53:44 -0000 >@@ -403,18 +403,15 @@ resgroup_thread_main(void *arg) > resource groups we don't own */ > error = svc_status(myname); > >- /* Recover dead service */ > if (error == 0) { > ret = RG_SUCCESS; > break; > } > >- error = svc_stop(myname, RG_STOP_RECOVER); >- if (error == 0) { >- error = handle_recover_req(myname, &newowner); >- if (error == 0) >- ret = RG_SUCCESS; >- } >+ /* Recover dead service */ >+ error = handle_recover_req(myname, &newowner); >+ if (error == 0) >+ ret = RG_SUCCESS; > > break; >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 229650
:
148657
|
155385
|
155386
|
155387
|
155388
|
155389
|
155835
|
156923
|
181341
|
205561
|
205861