From bbd59ab9a2e0fbbe67c33e951722d04c307f718e Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Thu, 17 Aug 2017 10:40:48 +0900 Subject: [PATCH] Update "repmgr cluster event" documentation and --help output --- README.md | 16 +++++++++++++++- repmgr-action-cluster.c | 3 +++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0460410f..cd8f13bd 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,9 @@ The following commands are available: repmgr node check repmgr cluster show - repmgr cluster event [--all] [--node-id] [--node-name] [--event] [--event-matching] + repmgr cluster matrix + repmgr cluster crosscheck + repmgr cluster event * `primary register` @@ -261,6 +263,18 @@ The following commands are available: able to connect to `node3` and therefore determine the state of outbound connections from that node. +* `cluster event` + + This outputs a formatted list of cluster events, as stored in the + `repmgr.events` table. Output is in reverse chronological order, and + can be filtered with the following options: + + * `--all`: outputs all entries + * `--limit`: set the maximum number of entries to output (default: 20) + * `--node-id`: restrict entries to node with this ID + * `--node-name`: restrict entries to node with this name + * `--event`: filter specific event + Backwards compatibility ----------------------- diff --git a/repmgr-action-cluster.c b/repmgr-action-cluster.c index ca7fdb4f..eb0d5d3d 100644 --- a/repmgr-action-cluster.c +++ b/repmgr-action-cluster.c @@ -416,6 +416,9 @@ do_cluster_event(void) log_debug("do_cluster_event():\n%s", query.data); res = PQexec(conn, query.data); + termPQExpBuffer(&query); + termPQExpBuffer(&where_clause); + if (PQresultStatus(res) != PGRES_TUPLES_OK) { log_error(_("unable to execute event query:\n %s"),