Skip to content

Commit

Permalink
Prepare/release 2.0 (#944)
Browse files Browse the repository at this point in the history
* Update source dependency: parson.

* Release v2.0.

* Update monitor make installcheck expected files.
  • Loading branch information
DimCitus committed Oct 7, 2022
1 parent 62f982b commit 73c0d7e
Show file tree
Hide file tree
Showing 15 changed files with 75 additions and 21 deletions.
39 changes: 39 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,42 @@
### pg_auto_failover v2.0 (October 7, 2022) ###

This new release includes support for Citus in pg_auto_failover, the usual
amount of bug fixes, and update documentation with new tutorials and
diagrams.

The source code repository branch "master" was renamed to "main". This
impacts the URLs of the docs for the not-yet released versions, and if
you're using your own local git clone you might need to change your remote
settings to follow the "main" branch now.

### Added
* Implement Citus support in pg_auto_failover. (#933)
* Improve our Citus support for modern Citus compatibility. (#939)

### Fixed
* Fix documentation of health_check_period to match code (#926)
* Bug fix: if process is stopped, refrain from signaling PID 0. (#921)
* Fix monitor extension for new Postgres 15 shared memory hooks. (#922)
* Refrain from using PGPASSWORD for pg_basebackup connection. (#768)
* Fix build on FreeBSD (sempahore union support). (#901)
* Improve tests stability around wait-until-pg-is-running. (#900)
* Avoid NULL pointer check (#898)
* Fix incorrect order of arguments in prototype (#887)
* Fix check for negative pid (#888)
* Fix potential out of bounds array access (#889)
* Fix incorrect indentation of foreach block (#884)
* docs: fix various typos (#885)
* Fix tests for a non-interactive environment. (#894)
* Fix ssl test by copying root client-side certificates. (#893)

### Changed
* Review the README, introduce a new first simple tutorial. (#942)
* Use our docker test infrastructure on GitHub Actions. (#937)
* Include Postgres 15 in our CI testing. (#923)
* Improve our docker compose file a little. (#724)
* Improve documentation thanks to user feedback. (#909)
* Trigger github action workflow on pull requests to master. (#895)

### pg_auto_failover v1.6.4 (January 22, 2022) ###

This is a bug fix release for the 1.6 series.
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ def __init__(self, **options):
# built documents.
#
# The short X.Y version.
version = "1.6"
version = "2.0"
# The full version, including alpha/beta/rc tags.
release = "1.6.4"
release = "2.0"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion src/bin/lib/parson/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2012 - 2020 Krzysztof Gabis
Copyright (c) 2012 - 2022 Krzysztof Gabis

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
12 changes: 9 additions & 3 deletions src/bin/lib/parson/parson.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
SPDX-License-Identifier: MIT
Parson 1.3.0 ( http://kgabis.github.com/parson/ )
Parson 1.4.0 (https://github.com/kgabis/parson)
Copyright (c) 2012 - 2022 Krzysztof Gabis
Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down Expand Up @@ -31,7 +31,7 @@
#include "parson.h"

#define PARSON_IMPL_VERSION_MAJOR 1
#define PARSON_IMPL_VERSION_MINOR 3
#define PARSON_IMPL_VERSION_MINOR 4
#define PARSON_IMPL_VERSION_PATCH 0

#if (PARSON_VERSION_MAJOR != PARSON_IMPL_VERSION_MAJOR)\
Expand Down Expand Up @@ -596,7 +596,7 @@ static JSON_Status json_object_add(JSON_Object *object, char *name, JSON_Value *
static JSON_Value * json_object_getn_value(const JSON_Object *object, const char *name, size_t name_len) {
unsigned long hash = 0;
parson_bool_t found = PARSON_FALSE;
unsigned long cell_ix = 0;
size_t cell_ix = 0;
size_t item_ix = 0;
if (!object || !name) {
return NULL;
Expand Down Expand Up @@ -980,6 +980,9 @@ static JSON_Value * parse_object_value(const char **string, size_t nesting) {
}
SKIP_CHAR(string);
SKIP_WHITESPACES(string);
if (**string == '}') {
break;
}
}
SKIP_WHITESPACES(string);
if (**string != '}') {
Expand Down Expand Up @@ -1025,6 +1028,9 @@ static JSON_Value * parse_array_value(const char **string, size_t nesting) {
}
SKIP_CHAR(string);
SKIP_WHITESPACES(string);
if (**string == ']') {
break;
}
}
SKIP_WHITESPACES(string);
if (**string != ']' || /* Trim array after parsing is over */
Expand Down
6 changes: 3 additions & 3 deletions src/bin/lib/parson/parson.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
SPDX-License-Identifier: MIT
Parson 1.3.0 ( http://kgabis.github.com/parson/ )
Parson 1.4.0 (https://github.com/kgabis/parson)
Copyright (c) 2012 - 2022 Krzysztof Gabis
Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down Expand Up @@ -35,10 +35,10 @@ extern "C"
#endif

#define PARSON_VERSION_MAJOR 1
#define PARSON_VERSION_MINOR 3
#define PARSON_VERSION_MINOR 4
#define PARSON_VERSION_PATCH 0

#define PARSON_VERSION_STRING "1.3.0"
#define PARSON_VERSION_STRING "1.4.0"

#include <stddef.h> /* size_t */

Expand Down
8 changes: 5 additions & 3 deletions src/bin/lib/parson/tests.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
SPDX-License-Identifier: MIT
Parson ( http://kgabis.github.com/parson/ )
Parson (https://github.com/kgabis/parson)
Copyright (c) 2012 - 2022 Krzysztof Gabis
Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down Expand Up @@ -307,6 +307,8 @@ void test_suite_3(void) {
TEST(json_parse_string("false") != NULL);
TEST(json_parse_string("\"string\"") != NULL);
TEST(json_parse_string("123") != NULL);
TEST(json_parse_string("[\"lorem\",]") != NULL);
TEST(json_parse_string("{\"lorem\":\"ipsum\",}") != NULL);

/* Test UTF-16 parsing */
TEST(STREQ(json_string(json_parse_string("\"\\u0024x\"")), "$x"));
Expand All @@ -318,9 +320,9 @@ void test_suite_3(void) {
g_malloc_count = 0;
TEST(json_parse_string(NULL) == NULL);
TEST(json_parse_string("") == NULL); /* empty string */
TEST(json_parse_string("[\"lorem\",]") == NULL);
TEST(json_parse_string("{\"lorem\":\"ipsum\",}") == NULL);
TEST(json_parse_string("{lorem:ipsum}") == NULL);
TEST(json_parse_string("{\"lorem\":\"ipsum\",]") == NULL);
TEST(json_parse_string("{\"lorem\":\"ipsum\",,}") == NULL);
TEST(json_parse_string("[,]") == NULL);
TEST(json_parse_string("[,") == NULL);
TEST(json_parse_string("[") == NULL);
Expand Down
2 changes: 1 addition & 1 deletion src/bin/lib/parson/tests/test_2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
"url" : "https:\/\/www.example.com\/search?q=12345",
"escaped chars" : "\" \\ \/",
"empty object" : {},
"empty array" : []
"empty array" : [],
}
4 changes: 2 additions & 2 deletions src/bin/pg_autoctl/azure.c
Original file line number Diff line number Diff line change
Expand Up @@ -1141,8 +1141,8 @@ azure_prepare_target_versions(KeyVal *env)

/* default values */
sformat(env->values[0], MAXCONNINFO, "13"); /* AZ_PG_VERSION */
sformat(env->values[1], MAXCONNINFO, "1.6"); /* AZ_PGAF_DEB_VERSION */
sformat(env->values[2], MAXCONNINFO, "1.6.4-1"); /* AZ_PGAF_DEB_REVISION */
sformat(env->values[1], MAXCONNINFO, "2.0"); /* AZ_PGAF_DEB_VERSION */
sformat(env->values[2], MAXCONNINFO, "2.0-1"); /* AZ_PGAF_DEB_REVISION */

for (int i = 0; i < 3; i++)
{
Expand Down
4 changes: 2 additions & 2 deletions src/bin/pg_autoctl/defaults.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
#define PG_AUTOCTL_STATE_VERSION 1

/* additional version information for printing version on CLI */
#define PG_AUTOCTL_VERSION "1.6.4"
#define PG_AUTOCTL_VERSION "2.0"

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

/* environment variable to use to make DEBUG facilities available */
#define PG_AUTOCTL_DEBUG "PG_AUTOCTL_DEBUG"
Expand Down
2 changes: 1 addition & 1 deletion src/monitor/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Licensed under the PostgreSQL License.

EXTENSION = pgautofailover
EXTVERSION = 1.6
EXTVERSION = 2.0

SRC_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))

Expand Down
2 changes: 1 addition & 1 deletion src/monitor/expected/dummy_update.out
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ select installed_version
-- should error because installed extension isn't compatible with .so
select * from pgautofailover.get_primary('unknown formation');
ERROR: loaded "pgautofailover" library version differs from installed extension version
DETAIL: Loaded library requires 1.6, but the installed extension version is dummy.
DETAIL: Loaded library requires 2.0, but the installed extension version is dummy.
HINT: Run ALTER EXTENSION pgautofailover UPDATE and try again.
2 changes: 1 addition & 1 deletion src/monitor/metadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

#include "storage/lockdefs.h"

#define AUTO_FAILOVER_EXTENSION_VERSION "1.6"
#define AUTO_FAILOVER_EXTENSION_VERSION "2.0"
#define AUTO_FAILOVER_EXTENSION_NAME "pgautofailover"
#define AUTO_FAILOVER_SCHEMA_NAME "pgautofailover"
#define AUTO_FAILOVER_FORMATION_TABLE "pgautofailover.formation"
Expand Down
7 changes: 7 additions & 0 deletions src/monitor/pgautofailover--1.6--2.0.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
--
-- extension update file from 1.6 to 2.0
--
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "CREATE EXTENSION pgautofailover" to load this file. \quit

-- no changes, just the version number
File renamed without changes.
2 changes: 1 addition & 1 deletion src/monitor/pgautofailover.control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
comment = 'pg_auto_failover'
default_version = '1.6'
default_version = '2.0'
module_pathname = '$libdir/pgautofailover'
relocatable = false
requires = 'btree_gist'

0 comments on commit 73c0d7e

Please sign in to comment.