Skip to content

Commit 31593a6

Browse files
authored
Prepare/release 1.6.3 (#828)
* Update borrowed Postgres code. * Bump the version number to 1.6.3 and add a changelog entry. * Review README and some docs. * Improve a changelog entry wording. * Fix Travis environment with using Ubuntu focal and Python: "3.7".
1 parent 56dd719 commit 31593a6

File tree

10 files changed

+109
-37
lines changed

10 files changed

+109
-37
lines changed

.travis.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
sudo: required
2-
dist: bionic
2+
dist: focal
33
language: c
44
python:
5-
- "3.6"
5+
- "3.7"
66
cache:
77
apt: true
88
directories:
@@ -42,23 +42,22 @@ before_install:
4242
- 'if [ -z "$LINTING" ]; then setup_apt; fi'
4343
- 'if [ -z "$LINTING" ]; then nuke_pg; fi'
4444
- python --version
45-
- pyenv versions
46-
- pyenv install -s 3.7
47-
- pyenv global 3.7
45+
- python3 --version
4846
- sudo apt-get install liblz4-1
4947
- sudo apt-get install liblz4-dev
5048
- sudo apt-get install bridge-utils
5149
- sudo apt-get install python3-pip
52-
- sudo pip3 install --upgrade pip
53-
- pip3 install --user pipenv
50+
- sudo apt-get install python3-nose
51+
- sudo apt-get install python3-psycopg2
52+
- sudo apt-get install python3-setuptools
53+
- sudo -H pip3 install pyroute2>=0.5.17
5454
- pip3 install --user black
5555
install:
5656
- 'if [ -n "$LINTING" ]; then install_uncrustify; fi'
5757
# cleanup uncrustify build files
5858
- 'if [ -n "$LINTING" ]; then rm -rf uncrustify*; fi'
5959
- 'if [ -z "$LINTING" ]; then install_pg; fi'
6060
- 'if [ -z "$LINTING" ]; then install_custom_pg; fi'
61-
- PIPENV_PIPFILE="${TRAVIS_BUILD_DIR}"/tests/Pipfile pipenv install --system --deploy
6261
- env
6362
- 'if [ -z "$LINTING" ]; then pg_config; fi'
6463
- 'if [ -z "$LINTING" ]; then PATH=`pg_config --bindir`:$PATH which pg_ctl; fi'

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
### pg_auto_failover v1.6.3 (November 5, 2021) ###
2+
3+
This is a bug fix release for the 1.6 series.
4+
5+
This release also introduces a new ncurses interactive dashboard that makes
6+
it easier to understand the current state (and transitions) of a formation.
7+
The new command `pg_autoctl watch` can be used to monitor pg_auto_failover
8+
activity.
9+
10+
#### Added
11+
* New ncurses dashboard with command pg_autoctl watch (#809)
12+
13+
#### Changed
14+
* Allow setting maximum-backup-rate on create postgres step (#812)
15+
16+
#### Fixed
17+
* Work around pg_replication_slot_advance xmin maintenance bug. (#815)
18+
* Fix "Current State" to "Reported State", and a docs cross-ref.
19+
* Monitor config set postgresql.pg_ctl bug fix (#818)
20+
* Fix how we clean-up our logs semaphore. (#811)
21+
* Fix synchronous_standby_names return value when there is no primary (#807)
22+
123
### pg_auto_failover v1.6.2 (September 8, 2021) ###
224

325
This is a bug fix release for the 1.6 series.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ AZURE_LOCATION ?= francecentral
9797
# postgresql-${AZ_PG_VERSION}-auto-failover-${AZ_PGAF_DEB_VERSION}=${AZ_PGAF_VERSION}
9898
AZ_PG_VERSION ?= 13
9999
AZ_PGAF_DEB_VERSION ?= 1.6
100-
AZ_PGAF_DEB_REVISION ?= 1.6.2-1
100+
AZ_PGAF_DEB_REVISION ?= 1.6.3-1
101101

102102
export AZ_PG_VERSION
103103
export AZ_PGAF_DEB_VERSION

README.md

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ the _replication quorum_ of Postgres.
4141
## Dependencies
4242

4343
At runtime, pg_auto_failover depends on only Postgres. Postgres versions 10,
44-
11, 12, and 13 are currently supported.
44+
11, 12, 13, and 14 are currently supported.
4545

4646
At buildtime. pg_auto_failover depends on Postgres server development
4747
package like any other Postgres extensions (the server development package
@@ -58,7 +58,21 @@ to guides and troubleshooting information.
5858

5959
## Installing pg_auto_failover from packages
6060

61-
Ubuntu or Debian:
61+
Note that pg_auto_failover packages are also found in Postgres PGDG package
62+
repositories. If you're using those repositories already, you can install
63+
the packages from there.
64+
65+
### Ubuntu or Debian:
66+
67+
When using debian, two packages are provided for pg_auto_failover: the
68+
monitor Postgres extension is packaged separately and depends on the
69+
Postgres version you want to run for the monitor itself. The monitor's
70+
extension package is named `postgresql-14-auto-failover` when targetting
71+
Postgres 14.
72+
73+
Then another package is prepared that contains the `pg_autoctl` command, and
74+
the name of the package is `pg-auto-failover-cli`. That's the package that
75+
is needed for the Postgres nodes.
6276

6377
```bash
6478
# Add the repository to your system
@@ -71,7 +85,7 @@ sudo apt-get install postgresql-11-auto-failover
7185
/usr/bin/pg_autoctl --version
7286
```
7387

74-
Fedora, CentOS, or Red Hat:
88+
### Fedora, CentOS, or Red Hat:
7589

7690
```bash
7791
# Add the repository to your system
@@ -93,7 +107,7 @@ install`.
93107
Build dependencies example on debian for Postgres 11:
94108

95109
~~~ bash
96-
$ sudo apt-get install postgresql-server-dev-11 libssl-dev libkrb5-dev
110+
$ sudo apt-get install postgresql-server-dev-11 libssl-dev libkrb5-dev libncurses6
97111
~~~
98112

99113
Then build pg_auto_failover from sources with the following instructions:
@@ -117,6 +131,18 @@ install the `pg_autoctl` binary command in the directory pointed to by
117131

118132
Once the building and installation is done, follow those steps:
119133

134+
0. If you're building from sources, and if you've already been using tmux,
135+
then try the following command:
136+
137+
~~~ bash
138+
$ make cluster
139+
~~~
140+
141+
This creates a tmux session with multiple panes that are each running a
142+
node for pg_auto_failover: the monitor, a first Postgres node, a second
143+
Postgres node, and then there is another tmux pane for interactive
144+
commands.
145+
120146
1. Install and run a monitor
121147

122148
~~~ bash

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def __init__(self, **options):
7373
# The short X.Y version.
7474
version = "1.6"
7575
# The full version, including alpha/beta/rc tags.
76-
release = "1.6.2"
76+
release = "1.6.3"
7777

7878
# The language for content autogenerated by Sphinx. Refer to documentation
7979
# for a list of supported languages.

docs/ref/pg_autoctl_watch.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ your terminal window size changes:
7575
the Node column contains the groupId and the nodeId, separated by a
7676
colon, such as ``0:1`` for the first coordinator node.
7777

78-
- Reported Lag, or Lag(R)
78+
- Last Report, or Report
7979

8080
Time interval between now and the last known time when a node has
8181
reported to the monitor, using the ``node_active`` protocol.
@@ -84,14 +84,15 @@ your terminal window size changes:
8484
increment when either the ``pg_autoctl run`` service is not running, or
8585
when there is a network split.
8686

87-
- Health Lag, or Lag(H)
87+
- Last Check, or Check
8888

8989
Time inverval between now and the last known time when the monitor could
9090
connect to a node's Postgres instance, via its health check mechanism.
9191

92-
This value is expected to stay under 6s or abouts, and is known to
93-
increment when either the Postgres service is not running on the target
94-
node, or when there is a network split.
92+
This value is known to increment when either the Postgres service is not
93+
running on the target node, when there is a network split, or when the
94+
internal machinery (the health check worker background process)
95+
implements jitter.
9596

9697
- Host:Port
9798

src/bin/lib/pg/snprintf.c

Lines changed: 40 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Copyright (c) 1983, 1995, 1996 Eric P. Allman
33
* Copyright (c) 1988, 1993
44
* The Regents of the University of California. All rights reserved.
5-
* Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group
5+
* Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group
66
*
77
* Redistribution and use in source and binary forms, with or without
88
* modification, are permitted provided that the following conditions
@@ -321,7 +321,7 @@ static bool find_arguments(const char *format, va_list args,
321321
PrintfArgValue *argvalues);
322322
static void fmtstr(const char *value, int leftjust, int minlen, int maxwidth,
323323
int pointflag, PrintfTarget *target);
324-
static void fmtptr(void *value, PrintfTarget *target);
324+
static void fmtptr(const void *value, PrintfTarget *target);
325325
static void fmtint(long long value, char type, int forcesign,
326326
int leftjust, int minlen, int zpad, int precision, int pointflag,
327327
PrintfTarget *target);
@@ -377,7 +377,7 @@ dopr(PrintfTarget *target, const char *format, va_list args)
377377
int cvalue;
378378
long long numvalue;
379379
double fvalue;
380-
char *strvalue;
380+
const char *strvalue;
381381
PrintfArgValue argvalues[PG_NL_ARGMAX + 1];
382382

383383
/*
@@ -422,7 +422,8 @@ dopr(PrintfTarget *target, const char *format, va_list args)
422422
{
423423
format++;
424424
strvalue = va_arg(args, char *);
425-
Assert(strvalue != NULL);
425+
if (strvalue == NULL)
426+
strvalue = "(null)";
426427
dostr(strvalue, strlen(strvalue), target);
427428
if (target->failed)
428429
break;
@@ -653,8 +654,9 @@ dopr(PrintfTarget *target, const char *format, va_list args)
653654
strvalue = argvalues[fmtpos].cptr;
654655
else
655656
strvalue = va_arg(args, char *);
656-
/* Whine if someone tries to print a NULL string */
657-
Assert(strvalue != NULL);
657+
/* If string is NULL, silently substitute "(null)" */
658+
if (strvalue == NULL)
659+
strvalue = "(null)";
658660
fmtstr(strvalue, leftjust, fieldwidth, precision, pointflag,
659661
target);
660662
break;
@@ -664,7 +666,7 @@ dopr(PrintfTarget *target, const char *format, va_list args)
664666
strvalue = argvalues[fmtpos].cptr;
665667
else
666668
strvalue = va_arg(args, char *);
667-
fmtptr((void *) strvalue, target);
669+
fmtptr((const void *) strvalue, target);
668670
break;
669671
case 'e':
670672
case 'E':
@@ -978,7 +980,7 @@ fmtstr(const char *value, int leftjust, int minlen, int maxwidth,
978980
}
979981

980982
static void
981-
fmtptr(void *value, PrintfTarget *target)
983+
fmtptr(const void *value, PrintfTarget *target)
982984
{
983985
int vallen;
984986
char convert[64];
@@ -996,8 +998,8 @@ fmtint(long long value, char type, int forcesign, int leftjust,
996998
int minlen, int zpad, int precision, int pointflag,
997999
PrintfTarget *target)
9981000
{
999-
unsigned long long base;
10001001
unsigned long long uvalue;
1002+
int base;
10011003
int dosign;
10021004
const char *cvt = "0123456789abcdef";
10031005
int signvalue = 0;
@@ -1056,12 +1058,36 @@ fmtint(long long value, char type, int forcesign, int leftjust,
10561058
vallen = 0;
10571059
else
10581060
{
1059-
/* make integer string */
1060-
do
1061+
/*
1062+
* Convert integer to string. We special-case each of the possible
1063+
* base values so as to avoid general-purpose divisions. On most
1064+
* machines, division by a fixed constant can be done much more
1065+
* cheaply than a general divide.
1066+
*/
1067+
if (base == 10)
1068+
{
1069+
do
1070+
{
1071+
convert[sizeof(convert) - (++vallen)] = cvt[uvalue % 10];
1072+
uvalue = uvalue / 10;
1073+
} while (uvalue);
1074+
}
1075+
else if (base == 16)
10611076
{
1062-
convert[sizeof(convert) - (++vallen)] = cvt[uvalue % base];
1063-
uvalue = uvalue / base;
1064-
} while (uvalue);
1077+
do
1078+
{
1079+
convert[sizeof(convert) - (++vallen)] = cvt[uvalue % 16];
1080+
uvalue = uvalue / 16;
1081+
} while (uvalue);
1082+
}
1083+
else /* base == 8 */
1084+
{
1085+
do
1086+
{
1087+
convert[sizeof(convert) - (++vallen)] = cvt[uvalue % 8];
1088+
uvalue = uvalue / 8;
1089+
} while (uvalue);
1090+
}
10651091
}
10661092

10671093
zeropad = Max(0, precision - vallen);

src/bin/lib/pg/strerror.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,10 +252,8 @@ get_errno_symbol(int errnum)
252252
#endif
253253
case ESRCH:
254254
return "ESRCH";
255-
#ifdef ETIMEDOUT
256255
case ETIMEDOUT:
257256
return "ETIMEDOUT";
258-
#endif
259257
#ifdef ETXTBSY
260258
case ETXTBSY:
261259
return "ETXTBSY";

src/bin/pg_autoctl/azure.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1142,7 +1142,7 @@ azure_prepare_target_versions(KeyVal *env)
11421142
/* default values */
11431143
sformat(env->values[0], MAXCONNINFO, "13"); /* AZ_PG_VERSION */
11441144
sformat(env->values[1], MAXCONNINFO, "1.6"); /* AZ_PGAF_DEB_VERSION */
1145-
sformat(env->values[2], MAXCONNINFO, "1.6.2-1"); /* AZ_PGAF_DEB_REVISION */
1145+
sformat(env->values[2], MAXCONNINFO, "1.6.3-1"); /* AZ_PGAF_DEB_REVISION */
11461146

11471147
for (int i = 0; i < 3; i++)
11481148
{

src/bin/pg_autoctl/defaults.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#define PG_AUTOCTL_STATE_VERSION 1
1515

1616
/* additional version information for printing version on CLI */
17-
#define PG_AUTOCTL_VERSION "1.6.2"
17+
#define PG_AUTOCTL_VERSION "1.6.3"
1818

1919
/* version of the extension that we requite to talk to on the monitor */
2020
#define PG_AUTOCTL_EXTENSION_VERSION "1.6"

0 commit comments

Comments
 (0)