2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License, Version 1.0 only 2N/A * (the "License"). You may not use this file except in compliance 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 2N/A * Use is subject to license terms. 2N/A#
pragma ident "%Z%%M% %I% %E% SMI" 2N/A * Metadevice diskset interfaces 2N/A * Exported Entry Points 2N/A /* Make sure we own the set */ 2N/A * The mediator information (which is part of the set record) is 2N/A * stored in the local mddbs of each node in the diskset. 2N/A * Each node's rpc.metad daemon reads in the set 2N/A * records from that node's local mddb and caches them 2N/A * internally. Any process needing diskset information contacts its 2N/A * local rpc.metad to get this information. Since each node in the 2N/A * diskset is independently reading the set information from its local 2N/A * mddb, the set records in the local mddbs must stay 2N/A * in-sync, so that all nodes have a consistent view of the diskset. 2N/A * For a multinode diskset, explicitly verify that all nodes in the 2N/A * diskset are ALIVE (i.e. are in the API membership list). Otherwise, 2N/A * fail this operation since all nodes must be ALIVE in order to add 2N/A * the mediator information to the set record in their local mddb. 2N/A * If a panic of this node leaves the local mddbs set records 2N/A * out-of-sync, the reconfig cycle will fix the local mddbs and 2N/A * force them back into synchronization. 2N/A /* Parse the command line into a the md_h_arr_t structure */ 2N/A /* Make a list of nodes to check */ 2N/A /* Make sure that there are no redundant nodes */ 2N/A * Lock the set on current set members. 2N/A * Set locking done much earlier for MN diskset than for traditional 2N/A * diskset since lock_set and SUSPEND are used to protect against 2N/A * other metaset commands running on the other nodes. 2N/A /* Make sure we are blocking all signals */ 2N/A /* All nodes are guaranteed to be ALIVE */ 2N/A * Lock out other meta* commands by suspending 2N/A * class 1 messages across the diskset. 2N/A /* All nodes are guaranteed to be ALIVE */ 2N/A /* Check existing mediators against new, if any */ 2N/A /* Copy the current mediator list for rollback */ 2N/A /* Setup the mediator record roll-back structure */ 2N/A * For a MN diskset the mediator is not given a list of 2N/A * hosts in the set. Instead a generic name (multiowner) is 2N/A * given to the mediator which will allow any node to access 2N/A * the mediator data as long as it provides the correct 2N/A * setname and set number. In a MN diskset, the mediator 2N/A * data is only used when a first node joins the diskset 2N/A * and becomes the master of the MN diskset. 2N/A * The traditional diskset code keeps the host list in 2N/A * the mediator record up to date with respect to the host 2N/A * list in the traditional diskset. This keeps an unauthorized 2N/A * node in the traditional diskset from accessing the data 2N/A * in the mediator record and being able to 'take' the 2N/A * This additional check is needed in the traditional diskset 2N/A * since a panic during the metaset command can leave 2N/A * the diskset with some nodes thinking that an 2N/A * action has occurred and other nodes thinking the opposite. 2N/A * A node may have really been removed from a diskset, but 2N/A * that node doesn't realize this so this node must be 2N/A * blocked from using the mediator data when attempting 2N/A * to 'take' the diskset. 2N/A * (Traditional diskset code has each node's rpc.metad 2N/A * cleaning up from an inconsistent state without any 2N/A * knowledge from the other nodes in the diskset). 2N/A * In the MN diskset, the reconfig steps force a consistent 2N/A * state across all nodes in the diskset, so no node 2N/A * needs to be blocked from accessing the mediator data. 2N/A * This allow the MN diskset to use a common 'nodename' 2N/A * in the mediator record. This allows the mediator 2N/A * daemon to remain unchanged even though a large number of 2N/A * nodes are supported by the MN diskset. 2N/A /* Merge new mediators into the set record */ 2N/A * Setup the kernel mediator list, which also validates that the 2N/A * hosts have valid IP addresses 2N/A /* Copy the hostnames */ 2N/A /* Resolve the IP addresses for the host list */ 2N/A /* Bring the mediator record up to date with the set record */ 2N/A /* END CHECK CODE */ 2N/A /* Lock the set on current set members */ 2N/A /* all signals already blocked for MN disket */ 2N/A /* Skip empty slots */ 2N/A * Add the new mediator information to all hosts in the set. 2N/A * For MN diskset, each node sends mediator list to its kernel. 2N/A /* All nodes are guaranteed to be ALIVE */ 2N/A /* Skip empty slots */ 2N/A /* Inform the mediator hosts of the new information */ 2N/A /* medr contains new mediator node list */ 2N/A /* In MN diskset, mediator list updated in clnt_updmeds call */ 2N/A * If only 50% mddbs available, mediator will be 2N/A * golden by this ioctl on a traditional diskset. 2N/A * On a MN disket, this only happens if the mediator 2N/A * add operation is executed on the master node. 2N/A * If a slave node is adding the mediator, the mediator 2N/A * won't be marked golden until the next mddb change. 2N/A * Unlock diskset by resuming messages across the diskset. 2N/A * Just resume all classes so that resume is the same whether 2N/A * just one class was locked or all classes were locked. 2N/A /* All nodes are guaranteed to be ALIVE */ 2N/A "Unable to resume rpc.mdcommd.\n"));
2N/A /* All nodes are guaranteed to be ALIVE */ 2N/A /* Skip empty slots */ 2N/A /* release signals back to what they were on entry */ 2N/A /* all signals already blocked for MN disket */ 2N/A * In MN diskset, mediator list updated in clnt_updmeds call 2N/A * rb_medr contains the rollback mediator node list. 2N/A * Send the rollback mediator information to the 2N/A * new mediator node list. If a node had this RPC 2N/A * called, but its node is not in the mediator node 2N/A * list, rpc.metamedd will delete the mediator 2N/A * record on that node. 2N/A /* Delete mediator information from all hosts in the set */ 2N/A /* All nodes are guaranteed to be ALIVE */ 2N/A /* Skip empty slots */ 2N/A * Unlock diskset by resuming messages across the diskset. 2N/A * Just resume all classes so that resume is the same whether 2N/A * just one class was locked or all classes were locked. 2N/A /* All nodes are guaranteed to be ALIVE */ 2N/A "Unable to resume rpc.mdcommd.\n"));
2N/A /* All nodes are guaranteed to be ALIVE */ 2N/A /* Skip empty slots */ 2N/A /* release signals back to what they were on entry */ 2N/A /* Make sure we own the set */ 2N/A * The mediator information (which is part of the set record) is 2N/A * stored in the local mddbs of each node in the diskset. 2N/A * Each node's rpc.metad daemon reads in the set 2N/A * records from that node's local mddb and caches them 2N/A * internally. Any process needing diskset information contacts its 2N/A * local rpc.metad to get this information. Since each node in the 2N/A * diskset is independently reading the set information from its local 2N/A * mddb, the set records in the local mddbs must stay 2N/A * in-sync, so that all nodes have a consistent view of the diskset. 2N/A * For a multinode diskset, explicitly verify that all nodes in the 2N/A * diskset are ALIVE (i.e. are in the API membership list). Otherwise, 2N/A * fail this operation since all nodes must be ALIVE in order to delete 2N/A * the mediator information from the set record in their local mddb. 2N/A * If a panic of this node leaves the local mddbs set records 2N/A * out-of-sync, the reconfig cycle will fix the local mddbs and 2N/A * force them back into synchronization. 2N/A /* Make a list of nodes to check */ 2N/A /* Save a copy of the current mediator information */ 2N/A /* Setup the mediator record for rollback */ 2N/A * In MN diskset, use a generic nodename, multiowner, in the 2N/A * mediator record which allows any node to access mediator 2N/A * information. MN diskset reconfig cycle forces consistent 2N/A * in the MN diskset. This allows the relaxation of 2N/A * node name checking in rpc.metamedd for MN disksets. 2N/A * In the traditional diskset, only a node that is in the 2N/A * mediator record's diskset nodelist can access mediator 2N/A /* Delete the mediators requested from the set */ 2N/A /* END CHECK CODE */ 2N/A /* Lock the set on current set members */ 2N/A /* Make sure we are blocking all signals */ 2N/A * Lock the set on current set members. 2N/A * lock_set and SUSPEND are used to protect against 2N/A * other metaset commands running on the other nodes. 2N/A /* All nodes are guaranteed to be ALIVE */ 2N/A * Lock out other meta* commands by suspending 2N/A * class 1 messages across the diskset. 2N/A /* All nodes are guaranteed to be ALIVE */ 2N/A /* Skip empty slots */ 2N/A /* Update the mediator information on all hosts in the set */ 2N/A /* All nodes are guaranteed to be ALIVE */ 2N/A /* Skip empty slots */ 2N/A * Set up the parameters to the call to update the 2N/A * kernel mediator list 2N/A /* Resolve the IP addresses for the host list */ 2N/A /* Inform the mediator hosts of the new status */ 2N/A * medr contains the new mediator node list. 2N/A * Send the new mediator information to the 2N/A * new mediator node list. If a node had this RPC 2N/A * called, but its node is no longer in the new mediator 2N/A * node list, rpc.metamedd will delete the mediator 2N/A * record on that node. 2N/A * Unlock diskset by resuming messages across the diskset. 2N/A * Just resume all classes so that resume is the same whether 2N/A * just one class was locked or all classes were locked. 2N/A /* All nodes are guaranteed to be ALIVE */ 2N/A "Unable to resume rpc.mdcommd.\n"));
2N/A /* All nodes are guaranteed to be ALIVE */ 2N/A /* Skip empty slots */ 2N/A /* release signals back to what they were on entry */ 2N/A /* all signals already blocked for MN disket */ 2N/A * rb_medr contains the rollback mediator node list. 2N/A * Send the rollback mediator information to the 2N/A * new mediator node list. This will recreate the 2N/A * mediator record on all nodes where the mediator 2N/A * record had been removed. 2N/A /* Delete mediator information from all hosts in the set */ 2N/A /* All nodes are guaranteed to be ALIVE */ 2N/A /* Skip empty slots */ 2N/A /* Unlock the set */ 2N/A /* Don't test lock flag since guaranteed to be set if in rollback */ 2N/A * Unlock diskset by resuming messages across the diskset. 2N/A * Just resume all classes so that resume is the same whether 2N/A * just one class was locked or all classes were locked. 2N/A /* All nodes are guaranteed to be ALIVE */ 2N/A "Unable to resume rpc.mdcommd.\n"));
2N/A /* All nodes are guaranteed to be ALIVE */ 2N/A /* Skip empty slots */ 2N/A /* release signals back to what they were on entry */