diff options
author | Mark Wong <mark@2ndQuadrant.com> | 2019-09-14 17:08:20 -0400 |
---|---|---|
committer | Mark Wong <mark@2ndQuadrant.com> | 2019-09-14 17:08:20 -0400 |
commit | a654adf91ac0680fd10d422e10ab598ae863618f (patch) | |
tree | 30cf510fe72a1e08401c74f164ae26f63f2591bb | |
parent | 35e83cfd2b82a2ab39d8838628e0df218cdd5f24 (diff) |
Identify unknown states as background tasks
-rw-r--r-- | machine/m_common.c | 10 |
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 |