diff options
author | jkennedy <none@none> | 2006-11-07 07:36:23 -0800 |
---|---|---|
committer | jkennedy <none@none> | 2006-11-07 07:36:23 -0800 |
commit | ab3487b0f99a72f54cfcffc43f7efd2c4bb2d608 (patch) | |
tree | 4b0f6c2d7ab8320e5f3e8f59d21a5584243d3603 /usr/src/lib/lvm | |
parent | 166fae499b8c2c347337a348f0a38d1d0a0b4a7c (diff) | |
download | illumos-joyent-ab3487b0f99a72f54cfcffc43f7efd2c4bb2d608.tar.gz |
6331216 disksets: devid information not written to a newly created diskset
6345158 svm exited with error 1 in step cmmstep5, nodes panic
6402556 commd timeout should be a percentage of metaclust timeout value
Diffstat (limited to 'usr/src/lib/lvm')
-rw-r--r-- | usr/src/lib/lvm/libmeta/common/meta_mn_comm.c | 59 | ||||
-rw-r--r-- | usr/src/lib/lvm/libmeta/common/meta_set.c | 17 | ||||
-rw-r--r-- | usr/src/lib/lvm/libmeta/common/meta_set_drv.c | 20 | ||||
-rw-r--r-- | usr/src/lib/lvm/libmeta/common/metarpcopen.c | 9 |
4 files changed, 78 insertions, 27 deletions
diff --git a/usr/src/lib/lvm/libmeta/common/meta_mn_comm.c b/usr/src/lib/lvm/libmeta/common/meta_mn_comm.c index 02ad7bf1e6..e005e83348 100644 --- a/usr/src/lib/lvm/libmeta/common/meta_mn_comm.c +++ b/usr/src/lib/lvm/libmeta/common/meta_mn_comm.c @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -21,7 +20,7 @@ */ /* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -791,11 +790,12 @@ out: * MDE_DS_COMMDCTL_SUSPEND_FAIL if any failure occurred */ int -mdmn_suspend(set_t setno, md_mn_msgclass_t class) +mdmn_suspend(set_t setno, md_mn_msgclass_t class, long timeout) { - int *resp; - CLIENT *local_daemon; - md_mn_set_and_class_t msc; + int *resp; + CLIENT *local_daemon; + md_mn_set_and_class_t msc; + md_error_t xep = mdnullerror; if ((setno >= MD_MAXSETS) || (class >= MD_MN_NCLASSES)) { return (MDE_DS_COMMDCTL_SUSPEND_FAIL); @@ -806,6 +806,14 @@ mdmn_suspend(set_t setno, md_mn_msgclass_t class) clnt_pcreateerror("local_daemon"); return (MDE_DS_COMMDCTL_SUSPEND_FAIL); } + + if (timeout != 0) { + if (cl_sto(local_daemon, LOCALHOST_IPv4, timeout, &xep) != 0) { + clnt_destroy(local_daemon); + return (1); + } + } + msc.msc_set = setno; msc.msc_class = class; msc.msc_flags = 0; @@ -842,12 +850,13 @@ mdmn_suspend(set_t setno, md_mn_msgclass_t class) * MDE_DS_COMMDCTL_RESUME_FAIL on failure */ int -mdmn_resume(set_t setno, md_mn_msgclass_t class, uint_t flags) +mdmn_resume(set_t setno, md_mn_msgclass_t class, uint_t flags, long timeout) { - md_mn_set_and_class_t msc; - int ret = MDE_DS_COMMDCTL_RESUME_FAIL; - int *resp; - CLIENT *local_daemon; + md_mn_set_and_class_t msc; + int ret = MDE_DS_COMMDCTL_RESUME_FAIL; + int *resp; + CLIENT *local_daemon; + md_error_t xep = mdnullerror; if ((setno >= MD_MAXSETS) || (class >= MD_MN_NCLASSES)) { return (MDE_DS_COMMDCTL_RESUME_FAIL); @@ -859,6 +868,13 @@ mdmn_resume(set_t setno, md_mn_msgclass_t class, uint_t flags) return (MDE_DS_COMMDCTL_RESUME_FAIL); } + if (timeout != 0) { + if (cl_sto(local_daemon, LOCALHOST_IPv4, timeout, &xep) != 0) { + clnt_destroy(local_daemon); + return (1); + } + } + msc.msc_set = setno; msc.msc_class = class; msc.msc_flags = flags; @@ -909,12 +925,12 @@ mdmn_abort(void) * 1 on failure */ int -mdmn_reinit_set(set_t setno) +mdmn_reinit_set(set_t setno, long timeout) { - int ret = 1; - int *resp; - CLIENT *local_daemon; - + int ret = 1; + int *resp; + CLIENT *local_daemon; + md_error_t xep = mdnullerror; if ((setno == 0) || (setno >= MD_MAXSETS)) { return (1); @@ -926,6 +942,13 @@ mdmn_reinit_set(set_t setno) return (1); } + if (timeout != 0) { + if (cl_sto(local_daemon, LOCALHOST_IPv4, timeout, &xep) != 0) { + clnt_destroy(local_daemon); + return (1); + } + } + resp = mdmn_comm_reinit_set_1(&setno, local_daemon); if (resp != NULL) { diff --git a/usr/src/lib/lvm/libmeta/common/meta_set.c b/usr/src/lib/lvm/libmeta/common/meta_set.c index 397f016f7b..4b84be7b09 100644 --- a/usr/src/lib/lvm/libmeta/common/meta_set.c +++ b/usr/src/lib/lvm/libmeta/common/meta_set.c @@ -1928,6 +1928,10 @@ metadrivename_withdrkey( * devid code path can set and propagate the error and * eventually prevent did disks from being added to the * diskset under SunCluster systems + * + * Note that this code can be called through rpc.mdcommd. + * sdssc_version cannot be used because the library won't + * be bound. */ if ((strncmp(dnp->rname, "/dev/did/", strlen("/dev/did/")) == 0) || (MD_MNSET_DESC(sd))) @@ -1950,8 +1954,7 @@ metadrivename_withdrkey( * that's OK. dnp->devid will be null as it is in any * configuration with no devids. */ - if (meta_setdid(MD_LOCAL_SET, sideno + SKEW, key, - ep) < 0) + if (meta_setdid(MD_LOCAL_SET, sideno + SKEW, key, ep) < 0) return (NULL); if ((devidp = (ddi_devid_t)meta_getdidbykey(MD_LOCAL_SET, sideno+SKEW, key, ep)) != NULL) { @@ -4224,6 +4227,7 @@ out: */ int meta_reconfig_choose_master( + long timeout, md_error_t *ep ) { @@ -4356,8 +4360,13 @@ meta_reconfig_choose_master( return (205); } - /* Send new nodelist to rpc.mdcommd */ - (void) mdmn_reinit_set(sp->setno); + /* reinit rpc.mdcommd with new nodelist */ + if (mdmn_reinit_set(sp->setno, timeout)) { + md_eprintf(dgettext(TEXT_DOMAIN, + "Could not re-initialise rpc.mdcommd for " + "set %s\n"), sp->setname); + return (1); + } meta_mc_log(MC_LOG5, dgettext(TEXT_DOMAIN, "Choose master for set %s completed: %s"), diff --git a/usr/src/lib/lvm/libmeta/common/meta_set_drv.c b/usr/src/lib/lvm/libmeta/common/meta_set_drv.c index a2abef7eac..4c4eaf0d78 100644 --- a/usr/src/lib/lvm/libmeta/common/meta_set_drv.c +++ b/usr/src/lib/lvm/libmeta/common/meta_set_drv.c @@ -480,6 +480,26 @@ meta_set_adddrives( goto rollback; } + /* + * If this is not a MN set and the state flags do not indicate the + * presence of devids, update the set records on all nodes. + */ + if (!(sd->sd_flags & MD_SR_MB_DEVID) && !(MD_MNSET_DESC(sd))) { + if (meta_update_mb(sp, dd, ep) == 0) { + mdclrerror(ep); + + /* update the sr_flags on all hosts */ + for (i = 0; i < MD_MAXSIDES; i++) { + if (sd->sd_nodes[i][0] == '\0') + continue; + + if (clnt_upd_sr_flags(sd->sd_nodes[i], + sp, (sd->sd_flags | MD_SR_MB_DEVID), ep)) + goto rollback; + } + } + } + RB_TEST(6, "adddrives", ep) RB_PREEMPT; diff --git a/usr/src/lib/lvm/libmeta/common/metarpcopen.c b/usr/src/lib/lvm/libmeta/common/metarpcopen.c index bd0f4232f5..4e86a847eb 100644 --- a/usr/src/lib/lvm/libmeta/common/metarpcopen.c +++ b/usr/src/lib/lvm/libmeta/common/metarpcopen.c @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -20,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -146,7 +145,7 @@ cc_destroy(client_header_t *header) /* * Set the timeout value for this client handle. */ -static int +int cl_sto( CLIENT *clntp, char *hostname, |