2012-02-05 11:35:58 -05:00
|
|
|
/****************************************************************
|
|
|
|
* *
|
2012-03-24 14:06:46 -04:00
|
|
|
* Copyright 2006, 2012 Fidelity Information Services, Inc *
|
2012-02-05 11:35:58 -05:00
|
|
|
* *
|
|
|
|
* This source code contains the intellectual property *
|
|
|
|
* of its copyright holder(s), and is made available *
|
|
|
|
* under a license. If you do not know the terms of *
|
|
|
|
* the license, please stop and do not read further. *
|
|
|
|
* *
|
|
|
|
****************************************************************/
|
|
|
|
|
|
|
|
#include "mdef.h"
|
|
|
|
|
|
|
|
#include "gtm_string.h"
|
|
|
|
#include "gtm_stdio.h"
|
|
|
|
|
|
|
|
#include "gdsroot.h"
|
|
|
|
#include "gdsblk.h"
|
|
|
|
#include "gtm_facility.h"
|
|
|
|
#include "fileinfo.h"
|
|
|
|
#include "gdsbt.h"
|
|
|
|
#include "gdsfhead.h"
|
|
|
|
#include "filestruct.h"
|
|
|
|
#include "repl_msg.h"
|
|
|
|
#include "gtmsource.h"
|
|
|
|
#include "repl_shutdcode.h"
|
|
|
|
#include "repl_sem.h"
|
|
|
|
#include "util.h"
|
|
|
|
#include "cli.h"
|
|
|
|
#include "repl_log.h"
|
2012-03-24 14:06:46 -04:00
|
|
|
#include "repl_instance.h"
|
2012-02-05 11:35:58 -05:00
|
|
|
|
|
|
|
GBLREF jnlpool_addrs jnlpool;
|
|
|
|
GBLREF boolean_t holds_sem[NUM_SEM_SETS][NUM_SRC_SEMS];
|
|
|
|
GBLREF gtmsource_options_t gtmsource_options;
|
|
|
|
|
2012-03-24 14:06:46 -04:00
|
|
|
error_def(ERR_MUPCLIERR);
|
|
|
|
|
2012-02-05 11:35:58 -05:00
|
|
|
int gtmsource_needrestart(void)
|
|
|
|
{
|
|
|
|
gtmsource_local_ptr_t gtmsource_local;
|
|
|
|
sgmnt_addrs *repl_csa;
|
|
|
|
|
|
|
|
assert(holds_sem[SOURCE][JNL_POOL_ACCESS_SEM]);
|
|
|
|
|
|
|
|
gtmsource_local = jnlpool.gtmsource_local;
|
|
|
|
if (NULL != gtmsource_local)
|
|
|
|
{
|
|
|
|
assert(!STRCMP(gtmsource_options.secondary_instname, gtmsource_local->secondary_instname));
|
|
|
|
repl_log(stderr, TRUE, TRUE,
|
|
|
|
"Initiating NEEDRESTART operation on source server pid [%d] for secondary instance [%s]\n",
|
|
|
|
gtmsource_local->gtmsource_pid, gtmsource_options.secondary_instname);
|
|
|
|
} else
|
|
|
|
repl_log(stderr, TRUE, TRUE, "Initiating NEEDRESTART operation for secondary instance [%s]\n",
|
|
|
|
gtmsource_options.secondary_instname);
|
|
|
|
DEBUG_ONLY(repl_csa = &FILE_INFO(jnlpool.jnlpool_dummy_reg)->s_addrs;)
|
|
|
|
assert(!repl_csa->hold_onto_crit); /* so it is ok to invoke "grab_lock" and "rel_lock" unconditionally */
|
2012-03-24 14:06:46 -04:00
|
|
|
GRAB_LOCK(jnlpool.jnlpool_dummy_reg, ASSERT_NO_ONLINE_ROLLBACK);
|
2012-02-05 11:35:58 -05:00
|
|
|
if ((NULL != gtmsource_local) && (gtmsource_local->connect_jnl_seqno >= jnlpool.jnlpool_ctl->start_jnl_seqno))
|
|
|
|
util_out_print("Secondary Instance [!AZ] DOES NOT NEED to be restarted", TRUE, gtmsource_local->secondary_instname);
|
|
|
|
else
|
|
|
|
util_out_print("Secondary Instance [!AZ] NEEDS to be restarted first", TRUE, gtmsource_options.secondary_instname);
|
|
|
|
rel_lock(jnlpool.jnlpool_dummy_reg);
|
|
|
|
return (NORMAL_SHUTDOWN);
|
|
|
|
}
|