提交 c7c5b6d2 编写于 作者: J Jimmy Yih

Only allow fts probe process to touch fts probe pause GUC

Some master processes were calling gpvars_assign_gp_fts_probe_pause
when they should not. This was found when the new stats collecter
process errored out on this function call. We also move it to fts.c
where it will live alongside the other fts code.

Also, check for interrupts in fts sleep loop so that fts probe process
can process SIGHUP properly.
上级 999359d0
......@@ -1179,45 +1179,6 @@ gpvars_show_gp_gpperfmon_log_alert_level(void)
return gpperfmon_log_alert_level_to_string(gpperfmon_log_alert_level);
}
/*
* Request the fault-prober to suspend probes -- no fault actions will
* be taken based on in-flight probes until the prober is unpaused.
*/
bool
gpvars_assign_gp_fts_probe_pause(bool newval, bool doit, GucSource source)
{
if (doit)
{
/*
* We only want to do fancy stuff on the master (where we have a
* prober).
*/
if (ftsProbeInfo && Gp_segment == -1)
{
/*
* fts_pauseProbes is externally set/cleared; fts_cancelProbes is
* externally set and cleared by FTS
*/
ftsLock();
ftsProbeInfo->fts_pauseProbes = newval;
ftsProbeInfo->fts_discardResults = ftsProbeInfo->fts_discardResults || newval;
ftsUnlock();
/*
* If we're unpausing, we want to force the prober to re-read
* everything. (we want FtsNotifyProber()).
*/
if (!newval)
{
FtsNotifyProber();
}
}
gp_fts_probe_pause = newval;
}
return true;
}
/*
* gpvars_assign_gp_resource_manager_policy
* gpvars_show_gp_resource_manager_policy
......
......@@ -795,6 +795,8 @@ void FtsLoop()
if (elapsed < gp_fts_probe_interval && !shutdown_requested)
{
pg_usleep((gp_fts_probe_interval - elapsed) * USECS_PER_SEC);
CHECK_FOR_INTERRUPTS();
}
}
} /* end server loop */
......@@ -898,4 +900,33 @@ void FtsRequestPostmasterShutdown(CdbComponentDatabaseInfo *primary, CdbComponen
);
}
/* EOF */
/*
* Request the fault-prober to suspend probes -- no fault actions will
* be taken based on in-flight probes until the prober is unpaused.
*/
bool
gpvars_assign_gp_fts_probe_pause(bool newval, bool doit, GucSource source)
{
if (doit)
{
/*
* We only want to do fancy stuff on the master (where we have a
* prober).
*/
if (am_ftsprobe && ftsProbeInfo && Gp_segment == -1)
{
/*
* fts_pauseProbes is externally set/cleared; fts_cancelProbes is
* externally set and cleared by FTS
*/
ftsLock();
ftsProbeInfo->fts_pauseProbes = newval;
ftsProbeInfo->fts_discardResults = ftsProbeInfo->fts_discardResults || newval;
ftsUnlock();
}
gp_fts_probe_pause = newval;
}
return true;
}
......@@ -36,6 +36,7 @@
#include "pgstat.h"
#include "parser/scansup.h"
#include "postmaster/syslogger.h"
#include "postmaster/fts.h"
#include "replication/walsender.h"
#include "storage/bfz.h"
#include "storage/proc.h"
......
......@@ -319,9 +319,6 @@ extern bool gp_fts_probe_pause;
extern int gp_fts_transition_retries;
extern int gp_fts_transition_timeout;
extern bool gpvars_assign_gp_fts_probe_pause(bool newval, bool doit, GucSource source);
/*
* Parameter gp_connections_per_thread
*
......
......@@ -16,6 +16,7 @@
#ifndef FTS_H
#define FTS_H
#include "utils/guc.h"
#include "cdb/cdbutil.h"
#ifdef USE_SEGWALREP
......@@ -185,6 +186,9 @@ extern void FtsRequestPostmasterShutdown(CdbComponentDatabaseInfo *primary, CdbC
extern bool FtsMasterShutdownRequested(void);
extern void FtsRequestMasterShutdown(void);
/* Interface for setting FTS GUCs */
extern bool gpvars_assign_gp_fts_probe_pause(bool newval, bool doit, GucSource source);
/*
* If master has requested FTS to shutdown.
*/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册