summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Wong <mark@2ndQuadrant.com>2019-09-14 17:08:20 -0400
committerMark Wong <mark@2ndQuadrant.com>2019-09-14 17:08:20 -0400
commita654adf91ac0680fd10d422e10ab598ae863618f (patch)
tree30cf510fe72a1e08401c74f164ae26f63f2591bb
parent35e83cfd2b82a2ab39d8838628e0df218cdd5f24 (diff)
Identify unknown states as background tasks
-rw-r--r--machine/m_common.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/machine/m_common.c b/machine/m_common.c
index 8d478de..dfee4ef 100644
--- a/machine/m_common.c
+++ b/machine/m_common.c
@@ -20,13 +20,17 @@ char *backendstatenames[] =
char *procstatenames[] =
{
- "", " idle, ", " active, ", " idle txn, ", " fastpath, ", " aborted, ",
- " disabled, ", NULL
+ " other background task(s), ", " idle, ", " active, ", " idle txn, ",
+ " fastpath, ", " aborted, ", " disabled, ", NULL
};
void
update_state(int *pgstate, char *state)
{
+ /*
+ * pgstate is always cleared to 0 when the node is created, so it will be
+ * to STATE_UNDEFINED if there is no match when comparing the state
+ */
if (strcmp(state, "idle") == 0)
*pgstate = STATE_IDLE;
else if (strcmp(state, "active") == 0)
@@ -39,8 +43,6 @@ update_state(int *pgstate, char *state)
*pgstate = STATE_IDLEINTRANSACTION_ABORTED;
else if (strcmp(state, "disabled") == 0)
*pgstate = STATE_DISABLED;
- else
- *pgstate = STATE_UNDEFINED;
}
void